/* ============================================
   Event Parking Admin Portal - Site Styles
   BikeDoc Branding
   ============================================ */

/* --- CSS Variables --- */
:root {
    --primary: #5db0c4;
    --primary-dark: #4a9bb0;
    --secondary: #00aa55;
    --secondary-dark: #008c46;
    --dark: #333333;
    --light: #f5f5f5;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --sidebar-bg: #8EB8B8;
    --sidebar-hover: #7da8a8;
    --sidebar-active: #6d9898;
    --sidebar-width: 250px;
    --header-height: 56px;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 6px;
    --radius-lg: 10px;
    --transition: all 0.2s ease-in-out;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* --- Admin Header --- */
.admin-header {
    background: var(--primary);
    color: var(--white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.admin-header .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-header .logo-area img {
    height: 32px;
    width: auto;
}

.admin-header .user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--white);
}

.admin-header .user-menu a {
    color: var(--white);
    font-size: 13px;
    opacity: 0.9;
}

.admin-header .user-menu a:hover {
    opacity: 1;
    text-decoration: none;
}

.admin-header .user-menu .user-name {
    font-weight: 500;
    font-size: 14px;
}

/* --- Admin Layout --- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* --- Sidebar --- */
.admin-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 900;
    transition: var(--transition);
}

.sidebar-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: var(--white);
    font-size: 14px;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: var(--transition);
    text-decoration: none;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    border-left-color: var(--white);
    text-decoration: none;
}

.sidebar-menu li a.active,
.sidebar-menu li.active a {
    background: var(--sidebar-active);
    border-left-color: var(--white);
    font-weight: 600;
}

.sidebar-menu li a i,
.sidebar-menu li a .menu-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu .menu-heading {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

/* --- Admin Content Area --- */
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    background: #f5f7fa;
    min-height: calc(100vh - var(--header-height));
}

.admin-content .page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

.admin-content .page-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-top: -12px;
    margin-bottom: 20px;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th,
table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table th {
    background: #f9f9f9;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

table tbody tr:hover {
    background: #f0f6f8;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-pending {
    background: #e2e3e5;
    color: #383d41;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
    vertical-align: middle;
}

.btn:hover {
    text-decoration: none;
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

.btn-success:hover {
    background: var(--secondary-dark);
    color: var(--white);
}

.btn-danger {
    background: #dc3545;
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--dark);
}

.btn-outline:hover {
    background: var(--light);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn + .btn {
    margin-left: 8px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--dark);
}

.form-control {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--dark);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(93, 176, 196, 0.2);
}

.form-control::placeholder {
    color: #adb5bd;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 32px;
}

textarea.form-control {
    max-width: 100%;
    min-height: 100px;
    resize: vertical;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--primary);
}

.validation-message,
.field-validation-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* --- Grid Layout (lightweight Bootstrap-compatible) --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}

.row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

.g-3 {
    row-gap: 16px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.row .form-control {
    max-width: 100%;
}

@media (max-width: 768px) {
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* --- Stat Boxes (Dashboard) --- */
.stat-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-box:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* --- Alerts --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* --- Login Page --- */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 36px 32px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-container .login-logo {
    margin-bottom: 24px;
}

.login-container .login-logo img {
    height: 48px;
    width: auto;
}

.login-container h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.login-container p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-container .form-group {
    text-align: left;
}

.login-container .form-control {
    max-width: 100%;
}

.login-container .btn {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    margin-top: 8px;
}

.login-container .login-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--gray);
}

/* --- Page Toolbar (title + filters + actions in one row) --- */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 16px;
}

.page-toolbar .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    white-space: nowrap;
}

.page-toolbar .toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.page-toolbar .toolbar-filters .form-control {
    width: 200px;
    max-width: 200px;
    margin-bottom: 0;
    height: 34px;
    padding: 5px 10px;
    font-size: 13px;
}

.page-toolbar .toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.page-toolbar .toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
}

/* --- Filter Bar (legacy, kept for compat) --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    max-width: 220px;
    margin-bottom: 0;
}

.filter-bar .btn {
    white-space: nowrap;
}

.filter-bar .filter-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--dark);
    white-space: nowrap;
}

/* --- Footer --- */
.admin-footer {
    background: var(--dark);
    color: var(--white);
    text-align: center;
    padding: 16px 24px;
    font-size: 13px;
    margin-left: var(--sidebar-width);
}

.admin-footer a {
    color: var(--primary);
}

.admin-footer a:hover {
    color: var(--white);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.pagination li a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    text-decoration: none;
}

.pagination li.active span,
.pagination li.active a {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination li.disabled span {
    color: #ccc;
    cursor: not-allowed;
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--secondary);
}

.text-danger {
    color: #dc3545;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mr-1 { margin-right: 8px; }
.ml-1 { margin-left: 8px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.p-0 { padding: 0 !important; }

.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.w-100 {
    width: 100%;
}

/* --- Action Links in Tables --- */
.action-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-links a {
    font-size: 13px;
    white-space: nowrap;
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--dark);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 0;
        min-width: 0;
        overflow: hidden;
    }

    .admin-sidebar.open {
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
    }

    .admin-content {
        margin-left: 0;
        padding: 16px;
    }

    .admin-footer {
        margin-left: 0;
    }

    .admin-header {
        padding: 0 12px;
    }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--white);
        font-size: 22px;
        cursor: pointer;
        padding: 4px 8px;
        margin-right: 8px;
    }

    .stat-boxes {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .stat-box {
        padding: 16px 12px;
    }

    .stat-number {
        font-size: 24px;
    }

    .page-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-toolbar .toolbar-filters {
        flex-wrap: wrap;
        margin-left: 0;
        width: 100%;
    }

    .page-toolbar .toolbar-filters .form-control {
        width: 100%;
        max-width: 100%;
        flex: 1;
        min-width: 120px;
    }

    .page-toolbar .toolbar-actions {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }

    table {
        font-size: 13px;
    }

    table th,
    table td {
        padding: 8px 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .login-container {
        margin: 40px 16px;
        padding: 28px 20px;
    }

    .modal-content {
        width: 95%;
        padding: 16px;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}

/* --- Print Styles --- */
@media print {
    .admin-header,
    .admin-sidebar,
    .admin-footer,
    .sidebar-toggle,
    .filter-bar .btn,
    .action-links {
        display: none !important;
    }

    .admin-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: white !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
}
