/**
 * GUM Admin Panel - Royal Blue Theme
 */

:root {
    --royal-blue: #1a237e;
    --royal-blue-light: #3949ab;
    --royal-blue-dark: #0d1259;
    --accent: #00bcd4;
    --accent-light: #4dd0e1;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-700: #495057;
    --gray-900: #212529;
    --shadow: 0 4px 20px rgba(26, 35, 126, 0.15);
    --shadow-lg: 0 10px 40px rgba(26, 35, 126, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-dark) 100%);
    min-height: 100vh;
}

/* ==================== AUTH PAGES ==================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-light) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--royal-blue);
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.auth-header p {
    opacity: 0.9;
    font-size: 14px;
}

.auth-body {
    padding: 40px 30px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--royal-blue-light);
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-right: 45px;
}

.input-group-append {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.toggle-password {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    font-size: 18px;
}

.toggle-password:hover {
    color: var(--royal-blue);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-light) 100%);
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--royal-blue-dark) 0%, var(--royal-blue) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--royal-blue);
    color: var(--royal-blue);
}

.btn-outline:hover {
    background: var(--royal-blue);
    color: var(--white);
}

.btn-link {
    background: none;
    color: var(--royal-blue);
    text-decoration: none;
    padding: 0;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-footer {
    text-align: center;
    padding: 20px 30px;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
}

.auth-footer a {
    color: var(--royal-blue);
    text-decoration: none;
    font-weight: 500;
}

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

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background: #ffebee;
    color: var(--danger);
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border: 1px solid #c8e6c9;
}

.alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

/* OTP Input */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--royal-blue-light);
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.1);
}

.otp-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--gray-200);
}

.otp-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.otp-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--gray-700);
}

.otp-label i {
    width: 35px;
    height: 35px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--royal-blue);
}

.resend-timer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray-500);
}

.resend-timer strong {
    color: var(--royal-blue);
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--royal-blue-dark) 0%, var(--royal-blue) 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--royal-blue);
}

.sidebar-brand-text {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-title {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.menu-item.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border-left-color: var(--accent);
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--gray-100);
}

/* Top Navbar */
.top-navbar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--gray-500);
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.blue { background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-light) 100%); }
.stat-icon.green { background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%); }
.stat-icon.orange { background: linear-gradient(135deg, #e65100 0%, #ff9800 100%); }
.stat-icon.cyan { background: linear-gradient(135deg, #00838f 0%, #00bcd4 100%); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--royal-blue) 0%, var(--royal-blue-light) 100%);
    border-radius: 20px;
    padding: 40px;
    color: var(--white);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    right: -50px;
    top: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.welcome-card::after {
    content: '';
    position: absolute;
    right: 50px;
    bottom: -80px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.welcome-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 16px;
    position: relative;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.card-body {
    padding: 25px;
}

/* Modal */
.modal-overlay {
    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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
}

.modal-icon.success {
    background: #e8f5e9;
    color: var(--success);
}

.modal-icon.error {
    background: #ffebee;
    color: var(--danger);
}

.modal-box h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.modal-box p {
    color: var(--gray-500);
    margin-bottom: 25px;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .auth-body {
        padding: 30px 20px;
    }
    
    .otp-input {
        width: 42px;
        height: 48px;
        font-size: 20px;
    }
    
    .content-area {
        padding: 20px 15px;
    }
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Password strength indicator */
.password-strength {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.password-strength-bar.weak { width: 33%; background: var(--danger); }
.password-strength-bar.medium { width: 66%; background: var(--warning); }
.password-strength-bar.strong { width: 100%; background: var(--success); }

.password-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 5px;
}

/* Row layout for names */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Local mode badge */
.local-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--warning);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 9999;
}
