@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════════════════════
   W3CA Admin Panel — Design System
   ══════════════════════════════════════════════════════════ */

:root {
    /* Brand Colors */
    --orange: #f97316;
    --orange-dark: #ea580c;
    --orange-light: #fff7ed;
    --orange-rgb: 249, 115, 22;

    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-border: rgba(255,255,255,0.06);
    --sidebar-text: rgba(255,255,255,0.65);
    --sidebar-text-hover: #ffffff;
    --sidebar-item-hover: rgba(255,255,255,0.06);
    --sidebar-item-active: rgba(249,115,22,0.15);
    --sidebar-item-active-text: #f97316;
    --sidebar-width: 260px;

    /* Layout */
    --topbar-height: 64px;

    /* Content */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Status Colors */
    --green: #10b981;
    --green-light: #d1fae5;
    --green-text: #065f46;
    --red: #ef4444;
    --red-light: #fee2e2;
    --red-text: #991b1b;
    --yellow: #f59e0b;
    --yellow-light: #fef3c7;
    --yellow-text: #92400e;
    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --blue-text: #1e40af;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

    /* Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition: 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(249,115,22,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.login-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-text {
    font-size: 36px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -1px;
    display: block;
    margin-bottom: 8px;
}

.logo-text span {
    color: var(--orange);
}

.login-logo p {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    color: rgba(255,255,255,0.25);
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   PANEL LAYOUT
   ═══════════════════════════════════════════════════════════ */

.panel-app {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.sidebar-logo span {
    color: var(--orange);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--sidebar-text);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}

.sidebar-close:hover { color: white; }

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--sidebar-item-hover);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: var(--sidebar-item-active);
    color: var(--sidebar-item-active-text);
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-info strong {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    font-size: 12px;
    color: var(--sidebar-text);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
    color: #fca5a5;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    width: 100%;
}

.logout-btn:hover {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

/* ─── Main Content ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    flex-shrink: 0;
}
.hamburger:hover { color: var(--text-primary); }

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-content {
    flex: 1;
    padding: 28px 28px 40px;
    max-width: 1400px;
    width: 100%;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Light theme labels */
.modal-body .form-group label,
.filters .form-group label {
    color: var(--text-secondary);
}

/* Dark theme (login) labels */
.login-form .form-group label {
    color: rgba(255,255,255,0.7);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.1);
}

/* Login dark theme inputs */
.login-form input {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

.login-form input::placeholder {
    color: rgba(255,255,255,0.3);
}

.login-form input:focus {
    background: rgba(255,255,255,0.07);
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(var(--orange-rgb), 0.2);
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 44px;
}

.input-icon-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    transition: color var(--transition);
    padding: 4px;
}

.input-icon-btn:hover { color: rgba(255,255,255,0.7); }

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    color: var(--red);
    font-size: 13px;
    padding: 10px 12px;
    background: var(--red-light);
    border-radius: var(--radius);
    font-weight: 500;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.form-full { grid-column: 1 / -1; }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.2;
    font-family: inherit;
}

.btn svg { flex-shrink: 0; }

.btn-primary {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
    box-shadow: 0 2px 8px rgba(var(--orange-rgb), 0.3);
}
.btn-primary:hover {
    background: var(--orange-dark);
    border-color: var(--orange-dark);
    box-shadow: 0 4px 12px rgba(var(--orange-rgb), 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--red-light);
    color: var(--red-text);
    border-color: #fecaca;
}
.btn-danger:hover {
    background: #fecaca;
    border-color: #fca5a5;
}

.btn-success {
    background: var(--green-light);
    color: var(--green-text);
    border-color: #a7f3d0;
}
.btn-success:hover {
    background: #a7f3d0;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-full { width: 100%; }

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login button larger */
.login-form .btn {
    padding: 12px 18px;
    font-size: 15px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   PAGE SECTIONS & CARDS
   ═══════════════════════════════════════════════════════════ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-header-left p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-body {
    padding: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD STAT CARDS
   ═══════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--orange));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

thead {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

thead th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: #fafbfc; }

tbody td {
    padding: 13px 16px;
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Empty state */
.table-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.table-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.table-empty p {
    font-size: 15px;
    font-weight: 500;
}

/* Filters bar */
.filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

/* ─── Guide Tabs (Platform Kurulum Rehberi) ────────────── */
.guide-tab {
    padding: 10px 20px;
    border: 2px solid var(--border);
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    outline: none;
}

.guide-tab:hover {
    background: var(--orange-light) !important;
    border-color: var(--orange) !important;
    color: var(--orange-dark) !important;
}

.guide-tab.active {
    background: var(--orange) !important;
    border-color: var(--orange) !important;
    color: #ffffff !important;
}

.filter-tab:hover { color: var(--text-primary); }

.filter-tab.active {
    background: var(--bg-card);
    color: var(--orange);
    box-shadow: var(--shadow-sm);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--bg-main);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: var(--green-light); color: var(--green-text); }
.badge-red { background: var(--red-light); color: var(--red-text); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow-text); }
.badge-blue { background: var(--blue-light); color: var(--blue-text); }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }
.badge-orange { background: var(--orange-light); color: var(--orange-dark); }

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 201;
    width: 100%;
    max-width: 560px;
    padding: 16px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    line-height: 0;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

/* Large modal */
.modal-lg .modal-container {
    max-width: 720px;
}

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    overflow: hidden;
    position: relative;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; border: 0; }
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { background: var(--green-light); color: var(--green); }
.toast-error .toast-icon { background: var(--red-light); color: var(--red); }
.toast-warning .toast-icon { background: var(--yellow-light); color: var(--yellow); }
.toast-info .toast-icon { background: var(--blue-light); color: var(--blue); }

.toast-content { flex: 1; }
.toast-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--orange);
    animation: progressBar 3s linear forwards;
}

.toast-success .toast-progress { background: var(--green); }
.toast-error .toast-progress { background: var(--red); }
.toast-warning .toast-progress { background: var(--yellow); }
.toast-info .toast-progress { background: var(--blue); }

@keyframes progressBar {
    from { width: 100%; }
    to   { width: 0%; }
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD SPECIAL ELEMENTS
   ═══════════════════════════════════════════════════════════ */

.expiring-table .badge { font-size: 13px; }

.expiring-days {
    font-weight: 700;
}

.expiring-days.urgent { color: var(--red); }
.expiring-days.soon   { color: var(--yellow); }
.expiring-days.ok     { color: var(--green); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ═══════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); font-size: 13px; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.font-mono {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg-main);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% auto;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    from { background-position: 200% center; }
    to   { background-position: -200% center; }
}

.skeleton-row td {
    padding: 16px;
}

/* ═══════════════════════════════════════════════════════════
   PACKAGE CARDS
   ═══════════════════════════════════════════════════════════ */

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: all var(--transition);
}

.package-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.package-type-badge {
    position: absolute;
    top: 16px;
    right: 16px;
}

.package-price {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin: 8px 0 4px;
}

.package-price span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
}

.package-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.package-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.package-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   MESSAGE ACCORDION
   ═══════════════════════════════════════════════════════════ */

.message-row {
    cursor: pointer;
}

.message-row.unread td {
    font-weight: 600;
}

.message-row.unread td:first-child::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--orange);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.message-detail-row td {
    padding: 0;
    background: #fafbfc;
}

.message-detail-content {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.message-detail-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close { display: flex; }
    .sidebar-overlay.visible { display: block; }

    .main-content {
        margin-left: 0;
    }

    .hamburger { display: flex; }

    .app-content {
        padding: 20px 16px 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

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

    .modal-container {
        max-width: 100%;
        padding: 12px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters .search-input { max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 36px 24px;
    }
}
