/* Guthix Portal - Warm Slate Dark Theme
   Modern, sleek, simple design */

/* ===== CSS Variables ===== */
:root {
    /* Warm Slate Dark Theme — Teal Accent */
    --forest-dark: #17181c;
    --forest-primary: #5dcaa5;
    --forest-medium: #4ab892;
    --forest-light: #5dcaa5;
    --forest-pale: rgba(93, 202, 165, 0.1);

    /* Neutrals (inverted for dark theme) */
    --white: #1e1f23;
    --gray-50: #222328;
    --gray-100: #151618;
    --gray-200: rgba(255, 255, 255, 0.06);
    --gray-300: rgba(255, 255, 255, 0.1);
    --gray-400: #7a7974;
    --gray-500: #8a8984;
    --gray-600: #a3a29d;
    --gray-700: rgba(255, 255, 255, 0.08);
    --gray-800: #d4d2cd;
    --gray-900: #e8e6e1;

    /* Accents */
    --accent-gold: #e8c9a8;
    --accent-gold-light: rgba(232, 201, 168, 0.15);
    --error: #f87171;
    --error-light: rgba(220, 38, 38, 0.15);
    --success: #4ade80;
    --success-light: rgba(22, 163, 74, 0.15);

    /* Shadows (stronger for dark backgrounds) */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.2);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.2);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);

    /* Spacing */
    --sidebar-width: 260px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0e0f12 0%, #151618 50%, #1a1b20 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg), 0 25px 50px -12px rgb(0 0 0 / 0.25);
    width: 100%;
    max-width: 420px;
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #5dcaa5, #4ab892);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
}

.login-logo svg {
    width: 36px;
    height: 36px;
    color: #e8e6e1;
}

.login-title {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    color: var(--gray-900);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--forest-primary);
    box-shadow: 0 0 0 3px rgba(93, 202, 165, 0.15);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #5dcaa5, #4ab892);
    color: #151618;
    box-shadow: var(--shadow), 0 4px 12px rgba(93, 202, 165, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 6px 16px rgba(93, 202, 165, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== Error Messages ===== */
.error-list {
    background: var(--error-light);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

.error-list li {
    color: var(--error);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-list li::before {
    content: '!';
    width: 18px;
    height: 18px;
    background: var(--error);
    color: #e8e6e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

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

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: #17181c;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon svg {
    width: 24px;
    height: 24px;
    color: #e8e6e1;
}

.sidebar-logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #e8e6e1;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 0.25rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8e6e1;
}

.nav-link.active {
    background: rgba(93, 202, 165, 0.1);
    color: #5dcaa5;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-gold);
    color: var(--forest-dark);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--forest-dark);
    font-size: 0.9rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e8e6e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0;
    transition: var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
}

.logout-link:hover {
    color: #e8e6e1;
}

.logout-link svg {
    width: 16px;
    height: 16px;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.content-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-body {
    flex: 1;
    padding: 2rem;
}

/* ===== Dashboard Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition-fast);
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.green {
    background: var(--forest-pale);
    color: var(--forest-primary);
}

.stat-icon.gold {
    background: rgba(212, 165, 116, 0.15);
    color: var(--accent-gold);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
}

.stat-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-trend.down {
    background: var(--error-light);
    color: var(--error);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ===== Content Cards ===== */
.content-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 1.5rem;
}

/* ===== Placeholder States ===== */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    background: var(--forest-pale);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.placeholder-icon svg {
    width: 40px;
    height: 40px;
    color: var(--forest-primary);
}

.placeholder-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.placeholder-text {
    color: var(--gray-500);
    max-width: 400px;
    line-height: 1.6;
}

.placeholder-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-gold-light);
    color: var(--forest-dark);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 1.5rem;
}

/* ===== Recent Activity Table ===== */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th,
.activity-table td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.activity-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}

.activity-table tbody tr:hover {
    background: var(--gray-50);
}

.activity-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition-normal);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* ===== Utilities ===== */
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Clickable user profile in sidebar */
a.user-info {
    text-decoration: none;
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem;
    margin-bottom: 0.25rem;
    transition: var(--transition-fast);
}

a.user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

a.user-info.active {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Site Footer ===== */
.site-footer {
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

/* ===== Auth flow additions ===== */
.login-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.login-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.login-footer-link a {
    color: var(--forest-primary);
    text-decoration: none;
}

.login-footer-link a:hover {
    text-decoration: underline;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-row label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

.resend-form {
    text-align: center;
    margin-top: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--forest-primary);
    font-size: 0.875rem;
    cursor: pointer;
    font-family: inherit;
    padding: 0.25rem 0.5rem;
}

.btn-link:hover {
    text-decoration: underline;
}

.otp-input {
    text-align: center;
    font-family: 'Outfit', 'DM Sans', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 600;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.flash-success {
    background: var(--success-light);
    color: var(--success);
}

.flash-error {
    background: var(--error-light);
    color: var(--error);
}