/* ============================================
   BOONDOORS - Professional Green Theme
   ============================================ */

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

:root {
    --primary:       #0b3b24;
    --primary-light: #145c38;
    --primary-hover: #082c1b;
    --gold:          #c9a84c;
    --bg:            #0b3b24;
    --admin-bg:      #f0f4f2;
    --card-bg:       #ffffff;
    --text:          #1a1a1a;
    --text-muted:    #6b7280;
    --border:        #e5e7eb;
    --success-bg:    #ecfdf5;
    --success-text:  #065f46;
    --danger:        #dc2626;
    --danger-hover:  #b91c1c;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.1);
    --radius:        10px;
    --radius-sm:     6px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    background-color: var(--bg);
    min-height: 100vh;
}

/* ============================================
   PUBLIC FORM PAGE
   ============================================ */

.page-wrapper {
    min-height: 100vh;
    background: var(--bg);
    padding: 30px 16px 60px;
}

.container {
    max-width: 640px;
    margin: 0 auto;
}

/* Header */
.site-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 10px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    padding: 8px 24px 8px 10px;
}

.logo {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--gold);
}

.logo-container h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.site-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.site-header p {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    max-width: 420px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* Form */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(11, 59, 36, 0.1);
}

.question-item {
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.question-item label.question-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
    display: block;
}

.radio-group {
    display: flex;
    gap: 12px;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-muted);
}

.radio-btn input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.radio-btn:has(input:checked) {
    border-color: var(--primary);
    background: var(--success-bg);
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 13px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

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

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-full {
    width: auto;
    min-width: 260px;
    padding: 14px 40px;
    font-size: 16px;
    border: 2px solid var(--gold);
    border-radius: 50px;
    background: #111111;
    display: block;
    margin: 0 auto;
}

.btn-small {
    padding: 7px 14px;
    font-size: 13px;
    width: auto;
    font-weight: 600;
}

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

/* Error / Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

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

.error-text {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

/* Confirm note */
.confirm-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Success card */
.success-card {
    text-align: center;
    padding: 40px 28px;
    border-top: 4px solid var(--primary);
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.success-card h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.success-card p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   ADMIN PANEL
   ============================================ */

body.admin-body {
    background: var(--admin-bg);
}

.admin-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Admin Topbar */
.admin-topbar {
    background: var(--primary);
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
}

.admin-brand span {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
}

.admin-brand small {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-weight: 400;
    display: block;
    line-height: 1;
}

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

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.dash-card {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
}

.dash-card h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.dash-card .number {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.dash-card:nth-child(2) { border-left-color: #16a34a; }
.dash-card:nth-child(2) .number { color: #16a34a; }
.dash-card:nth-child(3) { border-left-color: var(--danger); }
.dash-card:nth-child(3) .number { color: var(--danger); }
.dash-card:nth-child(4) { border-left-color: #d97706; }
.dash-card:nth-child(4) .number { color: #d97706; }

/* Filters */
.filters-bar {
    background: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.filters-bar .form-control {
    flex: 1;
    min-width: 160px;
    padding: 9px 12px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    background: #fafafa;
}

/* Table */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

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

thead tr {
    background: var(--primary);
}

thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

tbody tr:hover {
    background: #f9fafb;
}

td {
    padding: 13px 16px;
    font-size: 14px;
    color: var(--text);
    vertical-align: middle;
}

td .id-badge {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

td .date-time {
    font-size: 13px;
    color: var(--text-muted);
}

/* Yes/No indicators */
.yn-yes {
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
}

.yn-no {
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
}

/* Status badges */
.status-ready {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #dcfce7;
    color: #15803d;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

.status-not-ready {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fee2e2;
    color: #b91c1c;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

.action-cell {
    white-space: nowrap;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px;
}

.pagination a,
.pagination span {
    padding: 7px 13px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.15s;
}

.pagination a:hover {
    background: var(--admin-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Detail view */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    padding: 14px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-item strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.detail-item span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

/* Section title in admin */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    margin-bottom: 10px;
}

.login-logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.login-logo p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
    }

    .admin-topbar {
        padding: 0 14px;
    }

    .filters-bar {
        flex-direction: column;
        gap: 10px;
    }

    .filters-bar .form-control,
    .filters-bar .btn {
        width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
    }

    .admin-brand small {
        display: none;
    }
}

@media (max-width: 420px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    thead th, td {
        padding: 10px 12px;
    }
}
