/* ============================================================
   MMBSF - Admin Panel Styles
   ============================================================ */

:root {
    --primary: #1a3a3a;
    --primary-light: #2d6a4f;
    --primary-dark: #0d1f1f;
    --accent: #fecb00;
    --accent-hover: #e0b800;
    --white: #ffffff;
    --off-white: #f8f9fa;
    --bg-light: #f0f4f0;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --danger: #dc3545;
    --danger-hover: #bb2d3b;
    --success: #28a745;
    --info: #17a2b8;
    --sidebar-width: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-700);
    line-height: 1.6;
    background: var(--bg-light);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1f1f 0%, #1a3a3a 50%, #0f2b2b 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.6s ease;
}

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

.login-header {
    text-align: center;
    padding: 40px 32px 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 15px rgba(254, 203, 0, 0.3);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-header h1 {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.login-form {
    padding: 32px;
}

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

.login-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.login-form label i {
    color: var(--primary-light);
    width: 16px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
    background: var(--off-white);
}

.login-form input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(254, 203, 0, 0.12);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.87rem;
    color: var(--gray-500);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-light);
    cursor: pointer;
}

.forgot-link {
    font-size: 0.87rem;
    color: var(--primary-light);
    font-weight: 500;
}

.forgot-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
}

.login-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 58, 58, 0.3);
}

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

.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--gray-100);
    text-align: center;
}

.login-footer a {
    color: var(--gray-500);
    font-size: 0.87rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
}

.login-footer a:hover {
    color: var(--primary);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--accent);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--transition);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.sidebar-link.active {
    background: rgba(254, 203, 0, 0.12);
    color: var(--accent);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background: rgba(254, 203, 0, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.admin-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
}

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

.logout-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(234, 40, 57, 0.2);
    color: #ea2839;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
}

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

.topbar-date {
    font-size: 0.88rem;
    color: var(--gray-500);
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--gray-300);
    transition: all var(--transition);
}

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

.stat-card--yellow { border-left-color: var(--accent); }
.stat-card--green { border-left-color: var(--success); }
.stat-card--red { border-left-color: var(--danger); }
.stat-card--blue { border-left-color: var(--info); }

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card--yellow .stat-card-icon {
    background: rgba(254, 203, 0, 0.12);
    color: #b8860b;
}

.stat-card--green .stat-card-icon {
    background: rgba(40, 167, 69, 0.12);
    color: var(--success);
}

.stat-card--red .stat-card-icon {
    background: rgba(220, 53, 69, 0.12);
    color: var(--danger);
}

.stat-card--blue .stat-card-icon {
    background: rgba(23, 162, 184, 0.12);
    color: var(--info);
}

.stat-card-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
}

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

/* ============================================================
   WIDGETS
   ============================================================ */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.widget {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.widget-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.widget-link {
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 500;
}

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

.widget-body {
    padding: 20px 24px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-light);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition);
}

.quick-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
}

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

.quick-btn--outline:hover {
    background: var(--primary);
    color: var(--white);
}

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 20px;
    font-size: 0.9rem;
}

/* ============================================================
   SECTION TOOLBAR
   ============================================================ */
.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-toolbar h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* ============================================================
   CRUD FORM
   ============================================================ */
.crud-form {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
}

.crud-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
}

.crud-form-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.crud-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0 4px;
    transition: color var(--transition);
}

.crud-close:hover {
    color: var(--danger);
}

.crud-form-body {
    padding: 24px;
}

.crud-form-body .form-group {
    margin-bottom: 16px;
}

.crud-form-body label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.crud-form-body input,
.crud-form-body select,
.crud-form-body textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.92rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
    background: var(--off-white);
}

.crud-form-body input:focus,
.crud-form-body select:focus,
.crud-form-body textarea:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(254, 203, 0, 0.1);
}

.crud-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 58, 58, 0.25);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 20px;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--off-white);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    border-bottom: 1px solid var(--gray-100);
}

.data-table tr:hover td {
    background: var(--off-white);
}

.data-table .empty-cell {
    text-align: center;
    color: var(--gray-400);
    padding: 40px 20px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.action-btn--edit {
    background: rgba(254, 203, 0, 0.15);
    color: #b8860b;
    margin-right: 6px;
}

.action-btn--edit:hover {
    background: var(--accent);
    color: var(--primary-dark);
}

.action-btn--delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.action-btn--delete:hover {
    background: var(--danger);
    color: var(--white);
}

/* ============================================================
   GALLERY GRID (Admin)
   ============================================================ */
.gallery-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item-admin {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    transition: all var(--transition);
}

.gallery-item-admin:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-item-admin .gallery-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.gallery-item-admin .gallery-info {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-item-admin .gallery-info span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast--success {
    background: var(--success);
}

.toast--error {
    background: var(--danger);
}

.toast--info {
    background: var(--info);
}

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

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 600px;
}

.text-muted {
    color: var(--gray-500);
    font-size: 0.88rem;
    margin-bottom: 12px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-number {
        font-size: 1.4rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .section-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .crud-form-body {
        padding: 16px;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
