/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #0f172a;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

:root {
    --slate-50: #f8fafc;
    --slate-100: #e2e8f0;
    --slate-200: #cbd5e1;
    --slate-300: #94a3b8;
    --slate-800: #1f2937;
    --slate-900: #0f172a;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;
    --emerald-500: #10b981;
    --amber-500: #f59e0b;
}

.app-body {
    background: var(--slate-50);
    color: var(--slate-900);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--slate-50);
}

.sidebar {
    width: 270px;
    background: #0b1224;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px 20px;
    gap: 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.25);
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.brand-sub {
    font-size: 12px;
    color: #94a3b8;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 8px 10px;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.3);
}

.sidebar-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    place-items: center;
    color: #c7d2fe;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: grid;
    gap: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #4338ca;
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.user-name {
    font-weight: 700;
    color: #e2e8f0;
}

.user-meta {
    font-size: 12px;
    color: #94a3b8;
}

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.w-100 { width: 100%; }

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 72px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.crumb-muted { color: #94a3b8; }
.crumb-separator { color: #cbd5e1; }
.crumb-current { color: #0f172a; text-transform: capitalize; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box input {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    min-width: 220px;
    outline: none;
    color: #0f172a;
}

.pill-muted {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
}

.content-area {
    padding: 28px 32px 56px;
    flex: 1;
    background: #f8fafc;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.12em;
    font-weight: 800;
    color: #6366f1;
    margin-bottom: 6px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 6px 0;
}

.page-subtitle {
    color: #475569;
    margin: 0;
    font-weight: 600;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-solid {
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.25);
}

.btn-outline {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

button.btn-outline {
    font-size: inherit;
    font-family: inherit;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: grid;
    gap: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 800;
}

.kpi-value {
    font-size: 28px;
    font-weight: 900;
}

.kpi-label {
    color: #475569;
    font-weight: 700;
}

.kpi-meta {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #10b981;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.card + .card { margin-top: 16px; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title {
    font-weight: 800;
    margin: 0;
}

.badge-soft {
    background: #eef2ff;
    color: #4338ca;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.table-modern {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.table-modern table {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead {
    background: #f8fafc;
}

.table-modern th,
.table-modern td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.table-modern th {
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #475569;
    background: #f1f5f9;
}

.table-modern tbody tr:hover {
    background: #f8fafc;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    background: #eef2ff;
    color: #4338ca;
}

.pill-emerald { background: #ecfdf3; color: #166534; }
.pill-amber { background: #fffbeb; color: #b45309; }

.recent-list { display: grid; gap: 12px; }

.recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.recent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2ff;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #4338ca;
}

.recent-text { font-weight: 700; color: #0f172a; }
.recent-time { color: #64748b; font-size: 12px; font-weight: 700; }

.public-shell {
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(99,102,241,0.12), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(59,130,246,0.1), transparent 30%),
                #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.public-main {
    width: min(960px, 100%);
}

.app-footer {
    padding: 18px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    text-align: center;
}

.app-footer__text {
    color: #475569;
    font-weight: 600;
}

.app-footer__text a {
    color: #4338ca;
    font-weight: 700;
    text-decoration: none;
}

/* Authentication Pages Styles */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    color: #667eea;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-check {
    margin-bottom: 20px;
}

.form-check-input {
    margin-right: 8px;
}

.form-check-label {
    color: #666;
    font-size: 14px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-block {
    width: 100%;
    display: block;
}

.divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 15px;
    color: #999;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.btn-google {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-google:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
}

.auth-footer p {
    color: #666;
    font-size: 14px;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.text-danger {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Email Confirmation Page */
.confirmation-icon {
    margin: 20px auto;
}

.confirmation-message {
    color: #666;
    font-size: 16px;
    margin: 20px 0;
}

.text-success {
    color: #4CAF50;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    padding-bottom: 100px;
}

.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-header .username {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-header p {
    font-size: 16px;
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    /* backdrop-filter: blur(10px); */
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    isolation: auto;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    color: #4CAF50;
}

/* Dashboard Content */
.dashboard-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}

.panel-card {
    background: rgba(255, 255, 255, 0.1);
    /* backdrop-filter: blur(10px); */
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.btn-add {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.data-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Chart Container */
.chart-container {
    height: 250px;
    position: relative;
}

.mt-3 {
    margin-top: 20px;
}

/* Recent Activity */
.recent-activity {
    margin-bottom: 80px;
}

.view-all {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.view-all:hover {
    opacity: 1;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.activity-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
}

.activity-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.activity-content {
    flex: 1;
}

.activity-content p {
    margin: 0;
    font-size: 14px;
}

.activity-content strong {
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    opacity: 0.7;
    display: block;
    margin-top: 3px;
}

.activity-icon {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    isolation: isolate;
}

.navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 20px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dropdown Menu Styles */
.navbar {
    position: relative;
    z-index: 10000;
}

.navbar-nav .dropdown {
    position: relative;
}

.dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    min-width: 200px;
    z-index: 10001 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    margin: 0 !important;
    pointer-events: auto !important;
    transform: translateZ(1000px) !important;
}

.dropdown-item {
    color: #333 !important;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 10002;
}

.dropdown-item:hover {
    background-color: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
}

.dropdown-header {
    color: #667eea !important;
    font-weight: 700;
    padding: 10px 20px;
    margin-bottom: 5px;
    pointer-events: none;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: rgba(0, 0, 0, 0.1);
}

/* Main Content Area */
main {
    flex: 1 0 auto;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 0;
    margin-top: auto;
    flex-shrink: 0;
    position: static !important;
    width: 100%;
}

.footer .container {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 30px 20px;
    }
}

/* Override backdrop-filter for all .card elements to prevent dropdown menu issues */
.card {
    backdrop-filter: none !important;
}