/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Section */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}
.loading-overlay.hidden { display:none; }

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.login-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input { width: 100%; padding-right: 40px; }
.input-icon { position: absolute; right: 12px; color: #94a3b8; }
.icon-btn { position: absolute; right: 8px; background: transparent; border: none; color: #64748b; cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: #f1f5f9; }

.form-row { display:flex; align-items:center; justify-content: space-between; margin: 8px 0 16px; }
.checkbox { display:flex; align-items:center; gap:8px; color:#475569; font-size: 13px; }
.link-btn { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.6); border-top-color: #fff; border-radius: 50%; display: none; }
.btn.loading .btn-spinner { display: inline-block; animation: spin 0.8s linear infinite; }
.btn.loading .btn-label { opacity: 0.7; }

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

.password-strength { display:flex; align-items:center; gap:8px; margin-top:8px; }
.password-strength .bar { height: 6px; width: 80px; background:#fee2e2; border-radius:4px; position: relative; overflow:hidden; }
.password-strength .bar::after { content:""; position:absolute; left:0; top:0; bottom:0; width: 25%; background:#ef4444; transition: width .2s ease, background .2s ease; }
.password-strength .label { font-size:12px; color:#64748b; }

.toast-container { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 3000; }
.toast { background:#111827; color:#fff; padding: 12px 16px; border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); display:flex; align-items:center; gap:10px; }
.toast.success { background:#065f46; }
.toast.error { background:#991b1b; }
.toast.info { background:#1f2937; }
.toast { transition: opacity .2s ease, transform .2s ease; }

.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.7); display:flex; align-items:center; justify-content:center; z-index: 2500; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #c7d2fe; border-top-color:#4f46e5; animation: spin .8s linear infinite; }

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}
.btn.loading { opacity: .9; }
.btn.loading:hover { transform: none; }

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Dashboard Section */
.dashboard-section {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    gap: 12px;
}

.nav-item:hover {
    background: #f8fafc;
    color: #3b82f6;
}

.nav-item.active {
    background: #eff6ff;
    color: #3b82f6;
    border-right: 3px solid #3b82f6;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.badge {
    background: #ef4444;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
}

.main-content {
    flex: 1;
    margin-left: 280px;
}

.top-bar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #1e293b;
}

#pageTitle {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.content-area {
    padding: 24px;
}

.content-section {
    display: none;
}

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

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-content p {
    color: #64748b;
    font-size: 14px;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-actions select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Data Lists */
.data-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.data-item {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.data-item:hover {
    background: #f8fafc;
}

.data-item:last-child {
    border-bottom: none;
}

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

.data-title {
    font-weight: 600;
    color: #1e293b;
}

.data-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
}

.data-content {
    color: #475569;
    line-height: 1.6;
    margin-bottom: 16px;
}

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

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

/* Notifications */
.notification-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}

.notification-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.notification-message {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
}

/* Settings */
.settings-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.setting-group {
    margin-bottom: 32px;
}

.setting-group h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.settings-form {
    max-width: 400px;
}

/* Content section minor tweaks */
#content .data-content img { display:block; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Recent Activity */
.recent-activity {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.recent-activity h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.seen-tag {
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-time {
    font-size: 12px;
    color: #64748b;
}

/* Notification controls */
.notif-controls { display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.notif-tabs { display:flex; gap:6px; background:#eef2ff; padding:6px; border-radius:10px; }
.notif-tab { background:transparent; border:none; padding:8px 10px; border-radius:8px; color:#3730a3; cursor:pointer; font-size:12px; }
.notif-tab.active { background:#fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.notif-search { flex:1; border:2px solid #e2e8f0; border-radius:8px; padding:8px 10px; font-size:13px; }

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .section-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 24px;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}
