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

:root {
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-hover: #141414;
    --border-subtle: #222222;
    --border-strong: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    
    --accent-primary: #ffffff;
    --accent-hover: #e0e0e0;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ==================
   LAYOUT (SIDEBAR + MAIN)
   ================== */
   
.app-layout {
    display: flex;
    width: 100%;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-base);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.nav-item svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
}

.user-profile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

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

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    background-color: var(--bg-surface);
}

.top-bar {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background-color: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    z-index: 50;
}

.top-bar-title {
    font-size: 18px;
    font-weight: 500;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* ==================
   COMPONENTS
   ================== */

.view-section {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view-section.active {
    display: block;
}

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

.card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-premium);
}

.card-header {
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Typography */
h1, h2, h3 {
    letter-spacing: -0.02em;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--text-secondary);
    background-color: var(--bg-base);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: transparent;
    color: var(--danger);
    border-color: var(--border-subtle);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-icon {
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}
.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Tables (Mobile Responsive) */
.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background-color: var(--bg-base);
    /* Subtle scrollbar for webkit */
}

.table-container::-webkit-scrollbar {
    height: 8px;
}
.table-container::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

table {
    width: 100%;
    min-width: 700px; /* Force scrolling on small devices */
    border-collapse: collapse;
}

th, td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-surface);
}

td {
    font-size: 14px;
    color: var(--text-primary);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

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

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background-color: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-success { background-color: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }

/* Notifications */
#notification-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-dropdown);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.success {
    border-left: 4px solid var(--success);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Auth / Centered Layouts */
.centered-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 24px;
}

.auth-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    margin-top: 24px;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.btn-google {
    width: 100%;
    background-color: var(--bg-base);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 12px 24px;
    font-size: 15px;
}

.btn-google:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--text-secondary);
}

.btn-google img {
    width: 20px;
    margin-right: 8px;
}

/* Helpers */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.stat-card {
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    padding: 24px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}
.stat-card h4 {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-card .value {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-primary);
}


/* ==================
   MOBILE RESPONSIVENESS
   ================== */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.open {
        display: block;
        opacity: 1;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .top-bar {
        padding: 0 24px;
    }
    
    .view-section {
        padding: 24px 16px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
}
