@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --border-clean: #e2e8f0;
    --border-focus: #000000;
    
    --primary: #000000;
    --primary-hover: #1e293b;
    
    --text-main: #000000;
    --text-muted: #475569;
    --text-placeholder: #94a3b8;
    
    --success: #16a34a;
    --danger: #dc2626;
    
    --sidebar-width: 260px;
    --transition-fast: 0.15s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide glowing orbs */
.glow-orb {
    display: none !important;
}

/* Layout Structures */
.admin-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-clean);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    padding-left: 0.5rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: #000000;
    color: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
    color: #000000;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item a:hover {
    color: var(--text-main);
    background: var(--bg-secondary);
}

.nav-item.active a {
    color: #ffffff;
    background: #000000;
}

.nav-item.active a svg {
    color: #ffffff;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-clean);
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.btn-logout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-clean);
    color: var(--text-muted);
    padding: 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    color: #000000;
    background: var(--bg-secondary);
    border-color: #000000;
}

/* Main Content Area */
.main-content {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    overflow-y: auto;
    max-height: 100vh;
}

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

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000000;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* Flat Panel */
.glass-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-clean);
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

/* Buttons (Compact and Professional) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
}

.btn-primary:hover {
    background: #27272a;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--border-clean);
    color: #000000;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: #000000;
}

.btn-danger {
    background: #ffffff;
    border-color: var(--border-clean);
    color: var(--danger);
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

/* Metric Cards Layout */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-clean);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

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

.metric-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon-wrapper svg {
    stroke: #000000 !important;
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000000;
}

.metric-footer {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Clean White Form Styling */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #000000;
}

.form-control {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #000000;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    width: 100%;
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px #000000;
}

.form-control::placeholder {
    color: var(--text-placeholder);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    user-select: none;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: #000000;
    cursor: pointer;
}

.invalid-feedback {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

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

/* Clean Table UI */
.table-responsive {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border-clean);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: #ffffff;
}

.table th {
    background: var(--bg-secondary);
    padding: 0.75rem 1.25rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-clean);
}

.table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-clean);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin {
    background: #000000;
    color: #ffffff;
    border: 1px solid #000000;
}

.badge-user {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

/* Alert Boxes */
.alert {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: var(--danger);
}

/* Search bar styling */
.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-placeholder);
    pointer-events: none;
}

.search-input {
    padding-left: 2.25rem;
}

/* Pagination container */
.pagination-container {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 0.2rem;
}

.pagination li a, .pagination li span {
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    border: 1px solid var(--border-clean);
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.8rem;
}

.pagination li a:hover {
    border-color: #000000;
    color: #000000;
    background: var(--bg-secondary);
}

.pagination li.active span {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.pagination li.disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Login Page Form */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-secondary);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border: 1px solid var(--border-clean);
    border-radius: 8px;
    padding: 2.25rem 2rem;
    box-shadow: var(--shadow-md);
}

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

.login-logo {
    width: 40px;
    height: 40px;
    background: #000000;
    color: #ffffff;
    border-radius: 4px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.3rem;
}

.login-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #000000;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

.login-footer-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-placeholder);
    margin-top: 1.75rem;
}

/* Utilities */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 {
    gap: 0.35rem;
}

.gap-2 {
    gap: 0.75rem;
}

.flex-align-center {
    display: flex;
    align-items: center;
}

.text-danger {
    color: var(--danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-clean);
}

/* Mobile Responsiveness & Sidebar Toggle */

.mobile-toggle-btn {
    display: none;
    background: transparent;
    border: none;
    color: #000;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .admin-container {
        display: block;
    }

    .mobile-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        left: calc(-1 * var(--sidebar-width));
        top: 0;
        bottom: 0;
        z-index: 50;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    
    body.sidebar-open {
        overflow: hidden;
    }

    .main-content {
        padding: 1.25rem;
        width: 100%;
        max-height: auto;
        overflow-y: visible;
    }

    .header-bar {
        padding-bottom: 1rem;
    }

    .page-title h1 {
        font-size: 1.25rem;
    }

    .glass-panel {
        padding: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }

    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
}

