:root {
    --teleofis-red: #981e1e; /* Фирменный красный */
    --teleofis-dark: #7a1818;
    --bg-color: #f4f6f8;     /* Светло-серый фон как на сайте */
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #dcdcdc;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
}

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* --- Header --- */
.app-header {
    background-color: white;
    border-bottom: 3px solid var(--teleofis-red);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    height: 40px;
    width: auto;
    display: block;
}

/* Стили для ссылки-логотипа */
.logo-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    line-height: 0; /* Убирает лишние отступы снизу у картинки внутри ссылки */
}

/* Опционально: эффект при наведении */
.logo-link:hover .brand-logo {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    .main-content { grid-template-columns: 1fr; }
    .header-content { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

h2 { 
    margin-top: 0; 
    font-size: 1.4rem; 
    color: var(--teleofis-red); 
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--text-main);
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
    font-size: 0.9rem; 
    color: var(--text-muted);
}

textarea {
    width: 100%;
    height: 140px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--teleofis-red);
}

/* --- Buttons --- */
.controls { margin-top: 15px; display: flex; gap: 10px; }

.btn-primary { 
    background: var(--teleofis-red); 
    color: white; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--teleofis-dark); }

.btn-secondary { 
    background: #e0e0e0; 
    color: #333; 
    border: none; 
    padding: 10px 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: 600;
}
.btn-secondary:hover { background: #d0d0d0; }

.btn-small { 
    background: var(--teleofis-red); 
    color: white; 
    border: none; 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.85rem;
    margin-top: 5px;
}

.btn-copy { 
    background: transparent; 
    border: 1px solid var(--teleofis-red); 
    color: var(--teleofis-red); 
    padding: 6px 12px; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 0.8rem; 
    margin-top: 8px;
    transition: all 0.2s;
}
.btn-copy:hover {
    background: var(--teleofis-red);
    color: white;
}

/* --- Output --- */
.output-box {
    background: #fafafa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    min-height: 80px;
    white-space: pre-wrap;
    font-size: 0.95rem;
    color: #222;
}

.footer-note {
    margin-top: 95px;
    text-align: right;
    font-size: 0.75rem;
    color: #aaa;
}

/* --- Admin Panel --- */
.admin-panel { 
    margin-top: 25px; 
    border-top: 1px solid var(--border-color); 
    padding-top: 15px; 
}

.admin-form { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-top: 10px; 
    background: #fdfdfd;
    padding: 10px;
    border-radius: 4px;
    border: 1px dashed #ddd;
}

.form-row {
    display: flex;
    gap: 10px;
}
.form-row input, .form-row select {
    flex: 1;
}

input, select { 
    padding: 8px; 
    border: 1px solid var(--border-color); 
    border-radius: 4px; 
    font-size: 0.9rem;
}

/* --- DB Table --- */
.db-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.85rem;
}

.db-table th, .db-table td {
    border: 1px solid #eee;
    padding: 6px;
    text-align: left;
}

.db-table th { 
    background-color: #f4f4f4; 
    color: var(--text-muted);
    font-weight: 600;
}

.db-name { 
    font-weight: bold; 
    color: var(--text-muted); 
    width: 25%; 
    font-size: 0.8rem;
}

.db-table input { 
    width: 95%; 
    padding: 4px; 
    border: 1px solid transparent; 
    background: transparent;
    font-size: 0.85rem;
}
.db-table input:hover, .db-table input:focus {
    border: 1px solid var(--teleofis-red);
    background: white;
    outline: none;
}

.db-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
