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

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-main: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Admin Layout */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    color: #cbd5e1;
    transition: var(--transition);
}

.sidebar-link:hover,
.sidebar-link.active {
    background-color: var(--primary);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: #ef4444;
    color: #fff;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    height: 70px;
    background-color: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.admin-body {
    padding: 32px;
    flex-grow: 1;
    overflow-y: auto;
}

/* Alert styles */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

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

.stat-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.stat-icon.blue { background-color: #3b82f6; }
.stat-icon.green { background-color: #10b981; }
.stat-icon.indigo { background-color: #6366f1; }
.stat-icon.amber { background-color: #f59e0b; }

.stat-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
}

/* Data Tables */
.admin-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
    overflow: hidden;
}

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

.card-header-admin h3 {
    font-size: 16px;
    font-weight: 600;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: #f8fafc;
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 24px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

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

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending { background-color: #fef3c7; color: #d97706; }
.badge-processing { background-color: #e0f2fe; color: #0284c7; }
.badge-completed { background-color: #d1fae5; color: #059669; }
.badge-cancelled { background-color: #fee2e2; color: #dc2626; }
.badge-active { background-color: #d1fae5; color: #059669; }
.badge-inactive { background-color: #f1f5f9; color: #64748b; }

/* Buttons & Controls */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-admin-primary {
    background-color: var(--primary);
    color: #fff;
}

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

.btn-admin-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-admin-danger:hover {
    background: #dc2626;
}

.btn-admin-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

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

.actions-cell {
    display: flex;
    gap: 8px;
}

.pagination-wrapper {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.pagination-wrapper nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

/* Hide duplicated mobile text buttons block when standard desktop pagination is rendered */
.pagination-wrapper nav > div:first-child:not(:only-child) {
    display: none !important;
}

.pagination-wrapper nav > div:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.pagination-wrapper nav > div:last-child > div:first-child p {
    margin: 0 !important;
    font-size: 13px !important;
    color: var(--text-light) !important;
}

.pagination-wrapper nav > div:last-child > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
}

/* Strictly constrain all SVG arrow icons in admin pagination to standard 14px size */
.pagination-wrapper svg,
.pagination-wrapper svg.w-5,
.pagination-wrapper svg.h-5,
.pagination-wrapper nav svg,
admin-content svg.w-5 {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

/* Style pagination links and page number buttons */
.pagination-wrapper a,
.pagination-wrapper span[aria-current="page"] > span,
.pagination-wrapper span[aria-disabled="true"] > span,
.pagination-wrapper span[aria-disabled="true"] {
    padding: 5px 10px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    border: 1px solid var(--border) !important;
    color: var(--text-dark) !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    box-sizing: border-box !important;
    margin: 0 1px !important;
}

.pagination-wrapper a:hover {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.pagination-wrapper span[aria-current="page"] > span {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    font-weight: 600 !important;
}

.pagination-wrapper span[aria-disabled="true"] > span,
.pagination-wrapper span[aria-disabled="true"] {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
    cursor: not-allowed !important;
}

/* Admin forms styling */
.admin-form {
    padding: 24px;
}

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

.admin-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.admin-form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    outline: none;
    font-size: 14px;
}

.admin-form-control:focus {
    border-color: var(--primary);
}

textarea.admin-form-control {
    min-height: 120px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    .sidebar-link {
        white-space: nowrap;
    }
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}
