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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* ── NAVBAR ── */
.navbar {
    background-color: #1e3a5f;
    color: white;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar-brand a {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 8px;
}

.navbar-menu li a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
}

.navbar-menu li a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.navbar-user a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
}

.navbar-user a:hover {
    color: white;
}

/* ── MAIN CONTENT ── */
.main-content {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

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

.btn-primary {
    background-color: #2563eb;
    color: white;
}
.btn-primary:hover { background-color: #1d4ed8; color: white; }

.btn-success {
    background-color: #16a34a;
    color: white;
}
.btn-success:hover { background-color: #15803d; color: white; }

.btn-warning {
    background-color: #d97706;
    color: white;
}
.btn-warning:hover { background-color: #b45309; color: white; }

.btn-danger {
    background-color: #dc2626;
    color: white;
}
.btn-danger:hover { background-color: #b91c1c; color: white; }

.btn-secondary {
    background-color: #6b7280;
    color: white;
}
.btn-secondary:hover { background-color: #4b5563; color: white; }

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

/* ── CARD ── */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 24px;
    margin-bottom: 24px;
}

/* ── TABLE ── */
.table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
}

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

thead {
    background-color: #1e3a5f;
    color: white;
}

thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

tbody tr:hover { background-color: #f8faff; }

tbody td {
    padding: 12px 16px;
    color: #374151;
}

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-open {
    background-color: #dcfce7;
    color: #16a34a;
}

.badge-closed {
    background-color: #fee2e2;
    color: #dc2626;
}

/* ── FORMS ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: #1f2937;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: #2563eb;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control.input-validation-error {
    border-color: #ef4444;
}

select.form-control {
    cursor: pointer;
}

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

.field-validation-error {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.validation-summary-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #dc2626;
}

/* ── AUTH PAGES ── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f0f2f5;
}

.auth-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 48px;
    width: 100%;
    max-width: 480px;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 32px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
}

.forgot-link {
    font-size: 14px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover { text-decoration: underline; }

.btn-block {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6b7280;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

/* ── ACTION BUTTONS ROW ── */
.action-buttons {
    display: flex;
    gap: 6px;
}

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

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

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .main-content { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .navbar { padding: 0 16px; }
    .navbar-menu { display: none; }
    .modal-container { width: 95%; margin: 16px; max-height: 90vh; }
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    width: 720px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease-out;
}

.modal-container form {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 0 0 10px 10px;
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal-lg {
    width: 840px;
}

/* ── QUILL EDITOR ── */
.quill-editor {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    min-height: 180px;
}

.quill-editor .ql-editor {
    min-height: 160px;
    font-size: 14px;
    line-height: 1.6;
}

.ql-toolbar.ql-snow {
    border-radius: 6px 6px 0 0;
    border-color: #e5e7eb;
}

.ql-container.ql-snow {
    border-color: #e5e7eb;
}

/* ── RICH TEXT DISPLAY ── */
.rich-text-display {
    line-height: 1.7;
    color: #374151;
    font-size: 14px;
}

.rich-text-display h1, .rich-text-display h2, .rich-text-display h3 {
    margin: 16px 0 8px;
    color: #1a1a2e;
}

.rich-text-display ul, .rich-text-display ol {
    margin: 8px 0;
    padding-left: 24px;
}

.rich-text-display p {
    margin: 8px 0;
}

/* ── REQUIRED INDICATOR ── */
.required {
    color: #ef4444;
    font-weight: 700;
}