/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #d54f4a;
    --primary-dark: #b8403c;
    --primary-light: #e06b67;
    --dark: #1A1A1A;
    --dark-2: #2a2a2a;
    --dark-3: #333333;
    --gray: #666;
    --gray-light: #999;
    --bg-light: #f5f5f5;
    --bg-card: #ffffff;
    --text-dark: #1A1A1A;
    --text-light: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== LOGIN PAGE ===== */
.login-body {
    background: var(--dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--dark-2);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 180px;
    display: block;
    margin: 0 auto;
}

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

.login-form label {
    color: var(--gray-light);
    font-size: 13px;
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}

.login-form .form-control {
    background: var(--dark-3);
    border: 1px solid var(--dark-3);
    color: var(--text-light);
}

.login-form .form-control:focus {
    border-color: var(--primary);
    background: var(--dark);
}

/* Microsoft SSO Button */
.btn-microsoft {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: var(--radius-sm);
    color: #3c4043;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-microsoft:hover {
    background: #f0f0f0;
    color: #3c4043;
    transform: translateY(-1px);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--dark-3);
}

.login-divider span {
    color: var(--gray-light);
    font-size: 13px;
    font-weight: 500;
}

/* ===== ADMIN LAYOUT ===== */
.admin-body {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--dark);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--dark-3);
}

.sidebar-logo {
    width: 140px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-light);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--text-light);
    background: var(--dark-2);
}

.sidebar-link.active {
    border-left: 3px solid var(--primary);
}

.sidebar-icon {
    font-size: 10px;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--dark-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    font-size: 13px;
    color: var(--gray-light);
}

.sidebar-logout {
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 32px;
    min-height: 100vh;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

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

.page-subtitle {
    color: var(--gray);
    margin-bottom: 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-secondary {
    background: var(--dark-3);
    color: var(--text-light);
}
.btn-secondary:hover {
    background: var(--dark-2);
    color: var(--text-light);
}

.btn-success {
    background: #2d8a4e;
    color: var(--text-light);
}
.btn-success:hover { background: #246e3e; color: var(--text-light); }

.btn-warning {
    background: #d4a017;
    color: var(--text-light);
}
.btn-warning:hover { background: #b8890f; color: var(--text-light); }

.btn-danger {
    background: #c0392b;
    color: var(--text-light);
}
.btn-danger:hover { background: #a93226; color: var(--text-light); }

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-copy {
    white-space: nowrap;
}

/* ===== FORMS ===== */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    max-width: 700px;
}

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

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    transition: var(--transition);
    background: var(--bg-card);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(213, 79, 74, 0.15);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 12px;
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-control-file {
    font-size: 13px;
    color: var(--gray);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-error {
    display: block;
    color: var(--primary);
    font-size: 12px;
    margin-top: 4px;
}

.preview-thumb {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    object-fit: cover;
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    max-width: 300px;
}

.search-bar .form-select {
    max-width: 200px;
}

/* ===== CARDS GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: block;
    color: var(--text-dark);
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: var(--text-dark);
}

.card-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 4px;
}

.card-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: #e8f5e9; color: #2d8a4e; }
.badge-draft { background: #fff3e0; color: #e65100; }
.badge-danger { background: #fce4ec; color: #c0392b; }
.badge-info { background: #e3f2fd; color: #1565c0; }

/* ===== DETAIL PAGES ===== */
.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.detail-card h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.detail-cover {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    max-height: 300px;
}

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

.detail-logo {
    text-align: center;
    margin-bottom: 20px;
}

.detail-logo img {
    max-width: 150px;
    max-height: 100px;
    object-fit: contain;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 14px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 { margin-bottom: 0; }

/* ===== COPY GROUP ===== */
.copy-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.copy-group-sm {
    margin-top: 0;
}

.copy-group .form-control {
    font-size: 12px;
    background: var(--bg-light);
}

.link-row {
    margin-bottom: 12px;
}

.link-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

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

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
    font-weight: 500;
}

/* ===== DASHBOARD ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.dashboard-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.list-simple {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    transition: var(--transition);
}

.list-item:last-child { border-bottom: none; }
a.list-item:hover { color: var(--primary); }

.list-item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.list-item-meta {
    font-size: 12px;
    color: var(--gray);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-dark);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.page-link:hover { background: var(--bg-light); color: var(--text-dark); }
.page-link.active { background: var(--primary); color: var(--text-light); border-color: var(--primary); }
.page-ellipsis { padding: 8px 6px; color: var(--gray); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray);
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 15px;
}

.empty-text {
    color: var(--gray);
    font-size: 14px;
}

/* ===== FLASH MESSAGES ===== */
.flash-container {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success { background: #e8f5e9; color: #2d8a4e; }
.flash-danger { background: #fce4ec; color: #c0392b; }
.flash-warning { background: #fff3e0; color: #e65100; }
.flash-info { background: #e3f2fd; color: #1565c0; }

.flash-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    position: relative;
    z-index: 1;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.modal-content h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--gray);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== PUBLIC PAGES ===== */
.public-body {
    background: var(--dark);
    min-height: 100vh;
    color: var(--text-light);
}

.public-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--dark-3);
}

.public-logo {
    width: 130px;
    display: block;
}

.public-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px;
}

.public-footer {
    text-align: center;
    padding: 24px;
    color: var(--gray);
    font-size: 12px;
}

/* Public Event Card */
.public-event-card {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.public-event-cover {
    width: 100%;
    max-height: 250px;
    overflow: hidden;
}

.public-event-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-event-info {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.public-event-info h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.public-event-meta {
    display: flex;
    gap: 16px;
    color: var(--gray-light);
    font-size: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.public-event-desc {
    color: var(--gray-light);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.public-event-address {
    color: var(--gray-light);
    font-size: 13px;
}

.public-form-section {
    padding: 24px;
}

.public-form-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.agency-tag {
    background: rgba(213, 79, 74, 0.15);
    border: 1px solid rgba(213, 79, 74, 0.3);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    color: var(--primary-light);
    margin-bottom: 20px;
}

.public-form-section .form-group label {
    color: var(--gray-light);
}

.public-form-section .form-control {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: var(--text-light);
}

.public-form-section .form-control:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.12);
}

.public-form-section .form-control::placeholder {
    color: var(--gray);
}

/* Confirmation page */
.confirmation-card {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.confirmation-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2d8a4e;
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.closed-icon {
    background: var(--primary);
}

.confirmation-card h1 {
    font-size: 24px;
    margin-bottom: 12px;
}

.confirmation-text {
    color: var(--gray-light);
    margin-bottom: 24px;
}

.confirmation-details {
    text-align: left;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}

.confirmation-details .detail-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.confirmation-details .detail-item:last-child { border-bottom: none; }

.confirmation-details label {
    color: var(--gray-light);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.confirmation-details span {
    color: var(--text-light);
}

.qrcode-section {
    margin-top: 24px;
}

.qrcode-section h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.qrcode-section p {
    color: var(--gray-light);
    font-size: 13px;
    margin-bottom: 16px;
}

.qrcode-image {
    max-width: 200px;
    border-radius: var(--radius-sm);
    background: white;
    padding: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .search-bar {
        flex-direction: column;
    }

    .search-bar .form-control,
    .search-bar .form-select {
        max-width: 100%;
    }

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

    .copy-group {
        flex-direction: column;
    }
}

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

    .form-card {
        padding: 20px;
    }

    .login-card {
        padding: 24px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
        text-align: center;
    }
}

/* ===== CHECKBOX LIST ===== */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    background: var(--bg-light);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}
