/* ============================================================
   TOURPIN TRAVELS — Admin Portal Stylesheet
   ============================================================ */

:root {
    --ink: #0a0a0a;
    --ink-soft: #262626;
    --muted: #737373;
    --line: #e5e5e5;
    --bg: #f5f5f4;
    --card: #ffffff;
    --accent: #0e7490;
    --accent-hover: #155e75;
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --sidebar-w: 260px;
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- Login screen ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0a0a0a 0%, #1f2937 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}
.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}
.login-card .subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}
.login-card .brand {
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 600;
}
.login-card .brand span { color: var(--accent); }

/* ---------- Layout ---------- */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #0a0a0a;
    color: #fff;
    padding: 2rem 0;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    overflow-y: auto;
}
.sidebar-brand {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.5rem;
    padding: 0 2rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1.5rem;
}
.sidebar-brand span { color: var(--accent); }

.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    padding: 0 2rem;
    margin: 1.5rem 0 0.5rem;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 450;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.sidebar-nav a.active {
    color: #fff;
    background: rgba(14,116,144,0.15);
    border-left-color: var(--accent);
}
.sidebar-nav a .icon { width: 18px; text-align: center; }

.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 2rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
.sidebar-footer a { color: var(--accent); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: calc(100vw - var(--sidebar-w));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.topbar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.topbar .user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.topbar .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ---------- Stat cards ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--line);
}
.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.stat-value {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.stat-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* ---------- Card / panel ---------- */
.panel {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.panel-head h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.9rem 1rem;
    text-align: left;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--line);
}
th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: #fafafa;
}
tbody tr:hover { background: #fafafa; }
td .thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-active, .badge-confirmed, .badge-success { background: #d1fae5; color: #065f46; }
.badge-pending, .badge-new { background: #fef3c7; color: #92400e; }
.badge-inactive, .badge-cancelled, .badge-closed { background: #fee2e2; color: #991b1b; }
.badge-draft, .badge-in_progress { background: #e0e7ff; color: #3730a3; }
.badge-completed, .badge-read, .badge-replied { background: #f3f4f6; color: #374151; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}
.btn-outline:hover { background: var(--bg); }
.btn-danger {
    background: transparent;
    color: var(--error);
    border-color: #fecaca;
}
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 1.25rem; }
.form-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--ink);
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--ink);
    transition: all 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14,116,144,0.1);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ---------- Alerts ---------- */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}
.empty-state h3 { color: var(--ink); margin-bottom: 0.5rem; }

.mobile-toggle { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s;
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; max-width: 100vw; padding: 1.25rem; }
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        background: var(--ink);
        color: #fff;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        margin-right: 0.75rem;
    }
    .topbar { flex-wrap: wrap; }
}
