/* ========================================
   Admin Design System
   ======================================== */
:root {
    --sidebar-width: 256px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 56px;
    --sidebar-bg: #1e1e2d;
    --sidebar-hover: #2a2a3c;
    --sidebar-active: #323248;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --gold: #d4a853;
    --admin-bg: #f4f6f9;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--admin-bg);
    margin: 0;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

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

/* ========================================
   Sidebar
   ======================================== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.sidebar-logo:hover { color: #fff; }

.sidebar-logo i {
    font-size: 1.35rem;
    color: var(--accent-light);
}

.btn-sidebar-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

.btn-sidebar-collapse {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all var(--transition);
}
.btn-sidebar-collapse:hover {
    color: rgba(255,255,255,0.8);
    background: var(--sidebar-hover);
}

/* Sidebar Nav */
.sidebar-nav {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-nav li { margin-bottom: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.55);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
    text-decoration: none;
    border: none;
}

.sidebar-link:hover {
    color: rgba(255,255,255,0.9);
    background: var(--sidebar-hover);
}

.sidebar-link.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(99,102,241,0.35);
    border-left: none;
}

.sidebar-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .sidebar-link {
    font-size: 0.84rem;
}

/* ========================================
   Top Bar
   ======================================== */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

.admin-topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.admin-user {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-user i { font-size: 1.1rem; }

/* ========================================
   Content Area
   ======================================== */
.admin-content {
    padding: 28px 28px 40px;
}

.admin-content h4 {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.admin-content h4 i {
    color: var(--accent);
    margin-right: 4px;
}

/* ========================================
   Cards
   ======================================== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 20px;
}

/* ========================================
   Stat Cards (Dashboard)
   ======================================== */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.stat-card .stat-icon.bg-blue   { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-card .stat-icon.bg-green  { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-card .stat-icon.bg-orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-card .stat-icon.bg-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.stat-card .stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-card .stat-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* ========================================
   Tables
   ======================================== */
.admin-table {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table {
    margin: 0;
    font-size: 0.88rem;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    padding: 12px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid #f3f4f6;
}

.table tbody tr:hover {
    background: #f9fafb;
}

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

/* ========================================
   Buttons
   ======================================== */
.btn { border-radius: 7px; font-size: 0.87rem; font-weight: 500; transition: all var(--transition); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.btn-success {
    background: #10b981;
    border-color: #10b981;
}
.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: #c7d2fe;
}
.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-outline-danger {
    color: #ef4444;
    border-color: #fecaca;
}
.btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline-secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: var(--text-primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ========================================
   Forms
   ======================================== */
.form-control {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
    transition: all var(--transition);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.form-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

textarea.form-control {
    resize: vertical;
}

/* ========================================
   Modals
   ======================================== */
.modal-content {
    border: none;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.modal-body { padding: 24px; }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 24px;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    font-weight: 600;
    font-size: 0.73rem;
    padding: 4px 8px;
    border-radius: 5px;
    letter-spacing: 0.02em;
}

.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #dbeafe; color: #1e40af; }

/* ========================================
   Alerts
   ======================================== */
.alert {
    border-radius: 8px;
    font-size: 0.88rem;
    border: none;
}

/* ========================================
   Scrollbar
   ======================================== */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ========================================
   Sidebar Collapsed State
   ======================================== */
.sidebar-collapsed .admin-sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .admin-main {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-header {
    padding: 20px 0 16px;
    justify-content: center;
}

.sidebar-collapsed .sidebar-text {
    display: none;
}

.sidebar-collapsed .sidebar-logo {
    justify-content: center;
}

.sidebar-collapsed .sidebar-logo .sidebar-text {
    display: none;
}

.sidebar-collapsed .btn-sidebar-collapse {
    display: none;
}

.sidebar-collapsed .sidebar-nav {
    padding: 8px 8px;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 10px;
    gap: 0;
}

.sidebar-collapsed .sidebar-link i {
    font-size: 1.2rem;
    width: auto;
}

.sidebar-collapsed .sidebar-footer {
    padding: 8px 8px 12px;
}

/* Tooltip on hover when collapsed */
.sidebar-collapsed .sidebar-nav .sidebar-link {
    position: relative;
}

.sidebar-collapsed .sidebar-nav .sidebar-link:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-collapsed-width) - 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

/* ========================================
   Responsive
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content {
        padding: 16px;
    }
}
