/* === Tropicana Admin Panel === */
:root {
    --olive:     #2E332F;
    --olive-mid: #3a4040;
    --olive-lt:  #4a5050;
    --gold:      #C8AA6E;
    --gold-lt:   #d9be8a;
    --beige:     #E8D8B7;
    --off-white: #F9F9F9;
    --text:      #e8e8e8;
    --text-muted:#9aaa9a;
    --danger:    #e05555;
    --success:   #5aaa6a;
    --warn:      #d4a020;
    --radius:    6px;
    --shadow:    0 2px 12px rgba(0,0,0,0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--olive);
    color: var(--text);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-lt); text-decoration: underline; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--olive);
}

.login-wrap {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: var(--olive-mid);
    border: 1px solid rgba(200,170,110,0.2);
    border-radius: var(--radius);
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo img {
    max-width: 200px;
    height: auto;
    opacity: 0.92;
}

.login-card h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.35rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--olive);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--off-white);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-control:focus {
    outline: none;
    border-color: var(--gold);
}

.btn-login,
.btn-primary {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--gold);
    color: var(--olive);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    margin-top: 1.25rem;
}
.btn-login:hover,
.btn-primary:hover { background: var(--gold-lt); }

.btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(200,170,110,0.4);
    color: var(--gold);
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(200,170,110,0.1); text-decoration: none; }

.btn-danger {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    background: transparent;
    border: 1px solid rgba(224,85,85,0.4);
    color: var(--danger);
    border-radius: var(--radius);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover { background: rgba(224,85,85,0.1); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}
.alert-error   { background: rgba(224,85,85,0.15);  border-left: 3px solid var(--danger); color: #f09090; }
.alert-success { background: rgba(90,170,106,0.15); border-left: 3px solid var(--success); color: #90d098; }
.alert-warn    { background: rgba(212,160,32,0.15); border-left: 3px solid var(--warn);  color: #d4b84a; }

/* ─── App Shell ──────────────────────────────────────────────────────────── */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar nav */
.sidebar {
    width: 220px;
    background: var(--olive-mid);
    border-right: 1px solid rgba(255,255,255,0.07);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
}

.sidebar-logo {
    max-width: 140px;
    height: auto;
    opacity: 0.85;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.nav-section {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.8rem 1rem 0.3rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--text);
    font-size: 0.88rem;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.05); text-decoration: none; color: var(--off-white); }
.nav-item.active { border-left-color: var(--gold); color: var(--gold); background: rgba(200,170,110,0.08); }
.nav-item svg, .nav-item .icon { width: 16px; height: 16px; opacity: 0.7; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.sidebar-footer a { color: var(--text-muted); }
.sidebar-footer a:hover { color: var(--danger); }

/* Main content */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

.topbar {
    background: var(--olive-mid);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--off-white);
}

.topbar-user {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.content {
    padding: 1.75rem 2rem;
    flex: 1;
}

/* ─── Page heading ───────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--gold);
}

/* ─── Cards / Stat boxes ─────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--olive-mid);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
    background: var(--olive-mid);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: rgba(255,255,255,0.04);
    padding: 0.65rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    font-size: 0.88rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
}
.badge-green  { background: rgba(90,170,106,0.2);  color: #90d098; }
.badge-gray   { background: rgba(150,150,150,0.15); color: #999; }
.badge-gold   { background: rgba(200,170,110,0.2);  color: var(--gold); }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-gold    { color: var(--gold); }
.text-danger  { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }

/* ─── Forms — extended ───────────────────────────────────────────────────── */
textarea.form-control {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aaa9a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.4;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.88rem;
}
.form-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    flex-shrink: 0;
    cursor: pointer;
}

/* Card wrapper for form sections */
.form-card {
    background: var(--olive-mid);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 1rem;
}

/* Section heading inside a form-card */
.form-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Multi-column form rows */
.form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 0;
}
.form-row .form-group { margin-bottom: 0; }
.form-row + .form-group,
.form-row + .form-row { margin-top: 1rem; }
.form-group + .form-group { margin-top: 1rem; }
.form-card > .form-group:not(:first-of-type) { margin-top: 1rem; }

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

code {
    font-family: monospace;
    font-size: 0.85em;
    background: rgba(255,255,255,0.06);
    padding: 0.1em 0.4em;
    border-radius: 3px;
}

/* ─── Translation badges (article list) ─────────────────────────────────── */
.badge-lang    { background: rgba(90,170,106,0.2);  color: #90d098; }
.badge-missing { background: rgba(224,85,85,0.18);  color: #f09090; }

/* ─── Form container max-width ───────────────────────────────────────────── */
.form-container { max-width: 860px; }

.form-group-mt { margin-top: 1rem; }

/* ─── Language divider (article form) ────────────────────────────────────── */
.lang-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.25rem 0 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.lang-divider::before,
.lang-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.07);
}

/* EN incomplete indicator (inline in section header) */
.en-incomplete-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: rgba(224,85,85,0.18);
    color: #f09090;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 500;
}

/* Language card subtle left accent */
.lang-card-ru { border-left: 2px solid rgba(200,170,110,0.35); }
.lang-card-en { border-left: 2px solid rgba(100,140,200,0.25); }

/* ─── Advanced / collapsible section ─────────────────────────────────────── */
.advanced-details { cursor: default; }

.advanced-summary {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    user-select: none;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary::after {
    content: '▸';
    font-size: 0.7rem;
    transition: transform 0.15s;
}
details[open] .advanced-summary::after { transform: rotate(90deg); }
.advanced-summary:hover { color: var(--text); }

/* ─── Dashboard action cards ─────────────────────────────────────────────── */
.dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    max-width: 600px;
}

.dash-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--olive-mid);
    border: 1px solid rgba(255,255,255,0.07);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius);
    color: var(--off-white);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-left-color 0.15s;
}
.dash-action-card:hover {
    background: rgba(200,170,110,0.1);
    color: var(--gold);
    border-left-color: var(--gold-lt);
    text-decoration: none;
}

.dash-action-new {
    border-left-color: rgba(200,170,110,0.3);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.dash-action-new:hover {
    border-left-color: var(--gold);
    color: var(--gold);
}

.dash-arrow {
    opacity: 0.4;
    font-size: 1rem;
    transition: opacity 0.15s, transform 0.15s;
}
.dash-action-card:hover .dash-arrow {
    opacity: 0.8;
    transform: translateX(3px);
}

/* ─── Quill editor — dark theme overrides ───────────────────────────────── */
.quill-hidden-field { display: none; }

.quill-editor {
    background: var(--olive);
    border-radius: 0 0 var(--radius) var(--radius);
    min-height: 320px;
}

/* Toolbar */
.ql-toolbar.ql-snow {
    background: var(--olive-lt);
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: var(--radius) var(--radius) 0 0;
}

.ql-container.ql-snow {
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-top: none !important;
    border-radius: 0 0 var(--radius) var(--radius);
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    color: var(--off-white);
}

/* Toolbar icon visibility — use clearly-visible light on dark background */
.ql-snow .ql-stroke       { stroke: rgba(255,255,255,0.72) !important; }
.ql-snow .ql-fill         { fill:   rgba(255,255,255,0.72) !important; }
.ql-snow .ql-picker-label { color:  rgba(255,255,255,0.72) !important; }

.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--gold) !important; }

.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill   { fill: var(--gold) !important; }

.ql-snow .ql-picker-label:hover,
.ql-snow .ql-picker-label.ql-active { color: var(--gold) !important; }

.ql-snow .ql-picker-options {
    background: var(--olive-mid);
    border: 1px solid rgba(255,255,255,0.15) !important;
}
.ql-snow .ql-picker-item       { color: var(--text); }
.ql-snow .ql-picker-item:hover { color: var(--gold); }

/* Editor content */
.ql-editor {
    min-height: 280px;
    color: var(--off-white);
    line-height: 1.7;
}
.ql-editor p,
.ql-editor ul,
.ql-editor ol { margin-bottom: 0.75em; }
.ql-editor h2 { font-size: 1.15rem; font-weight: 600; color: var(--gold); margin: 1.1em 0 0.5em; }
.ql-editor h3 { font-size: 1rem;    font-weight: 600; color: var(--beige); margin: 1em 0 0.4em; }
.ql-editor blockquote {
    border-left: 3px solid var(--gold);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-muted);
    font-style: italic;
}
.ql-editor a { color: var(--gold); }
.ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
