/* =========================================================
   Malayalam Mission Dubai — mobile-first design system
   Palette drawn from the organization's own logo (navy + teal)
   rather than a generic brand kit.
   ========================================================= */
:root {
    --primary:       #152A63;   /* deep navy — from the logo wordmark */
    --primary-dark:  #0D1B45;
    --primary-mid:   #23387C;
    --accent:        #2CA6A0;   /* teal — from the logo's book/wave motif */
    --accent-dark:   #1E8781;
    --gold:          #E8A94A;   /* used sparingly for highlights only */
    --bg:            #F3F6FA;
    --surface:       #FFFFFF;
    --dark:          #1A1D29;
    --muted:         #5C6478;
    --border:        #D8DEEC;
    --success-bg:    #DCFCE7;
    --success-text:  #16A34A;
    --danger-bg:     #FEF2F2;
    --danger-border: #FECACA;
    --danger-text:   #DC2626;
    --shadow:        0 2px 8px rgba(21, 42, 99, 0.10);
    --shadow-md:     0 4px 16px rgba(21, 42, 99, 0.16);
    --radius:        12px;
    --radius-sm:     8px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--dark);
    font-size: 14px;
    line-height: 1.55;
}

/* ===== Page shell ===== */
form {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

/* ===== Sticky header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    color: #fff;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.brand img {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.brand-text {
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
}

.brand-text small {
    font-weight: 400;
    font-size: 0.72em;
    color: rgba(255, 255, 255, 0.75);
}

.nav-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
}

#siteNav {
    position: absolute;
    top: 100%;
    right: 12px;
    left: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: none;
    flex-direction: column;
    padding: 6px;
    margin-top: 8px;
}

#siteNav.open {
    display: flex;
}

#siteNav a {
    color: var(--dark);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.92em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

#siteNav a:hover {
    background: var(--bg);
}

#siteNav a i {
    color: var(--accent);
    font-size: 1.05em;
    width: 18px;
    text-align: center;
}

/* ===== Gradient page banner ===== */
.page-banner {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 45%, var(--accent-dark) 100%);
    color: #fff;
    overflow: hidden;
    padding: 26px 16px 32px;
}

.page-banner-shapes::before,
.page-banner-shapes::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.page-banner-shapes::before {
    width: 180px;
    height: 180px;
    top: -90px;
    right: -50px;
}

.page-banner-shapes::after {
    width: 120px;
    height: 120px;
    bottom: -70px;
    left: -30px;
    background: rgba(44, 166, 160, 0.18);
}

.page-banner-inner {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.page-banner h1 {
    margin: 0 0 4px 0;
    font-size: 1.4em;
    font-weight: 600;
}

.page-banner p {
    margin: 0;
    font-size: 0.88em;
    color: rgba(255, 255, 255, 0.85);
}

.page-banner p a {
    color: var(--gold);
    font-weight: 600;
    text-decoration: underline;
}

.page-banner p a:hover,
.page-banner p a:active {
    color: #fff;
}

.site-footer {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.8em;
}

/* ===== Card pattern ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(216, 222, 236, 0.8);
    overflow: hidden;
    margin-bottom: 18px;
}

.card-header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-mid) 55%, var(--accent-dark) 100%);
    color: #fff;
    padding: 12px 16px;
    font-size: 0.86rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 16px;
}

/* ===== Form fields ===== */
.form-row {
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label,
.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.form-row .required {
    color: var(--danger-text);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 8px 0 0;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.88rem;
    font-family: 'Poppins', Arial, sans-serif;
    background: #FAFBFC;
    color: var(--dark);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

textarea {
    resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21, 42, 99, 0.12);
    background: #fff;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23152A63'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    background: #FAFBFC;
    font-size: 0.85em;
}

.dob-row {
    display: flex;
    gap: 8px;
}

.dob-row > div {
    flex: 1;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row label {
    margin: 0;
    font-weight: 400;
    color: var(--dark);
    font-size: 0.88rem;
}

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

.category-rules-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(232, 169, 74, 0.14);
    border: 1.5px solid var(--gold);
    color: #8A5A10;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
}

.category-rules-hint i {
    font-size: 1rem;
    flex-shrink: 0;
}

.checkbox-list label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: var(--dark);
    font-size: 0.88rem;
    margin: 4px 0;
}

/* ===== Buttons ===== */
.btn-submit {
    width: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-mid) 45%, var(--accent-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 15px;
    font-size: 1rem;
    font-family: 'Poppins', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active {
    transform: translateY(0);
}

/* ===== Alerts ===== */
.error-summary {
    background: var(--danger-bg);
    border: 1.5px solid var(--danger-border);
    color: var(--danger-text);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.error-summary ul {
    margin: 6px 0 0 0;
    padding-left: 18px;
    font-weight: 400;
}

.success-message {
    background: var(--success-bg);
    border: 1.5px solid rgba(22, 163, 74, 0.3);
    color: var(--success-text);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.92rem;
}

/* ===== Page banner actions (back/home icon buttons) ===== */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.icon-link-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

.icon-link-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ===== Dashboard tiles ===== */
.tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 6px;
}

.tile {
    border-radius: var(--radius);
    padding: 18px 14px;
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    min-height: 112px;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s;
}

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

.tile-students {
    background: linear-gradient(145deg, var(--primary-mid), var(--primary-dark));
}

.tile-teachers {
    background: linear-gradient(145deg, var(--accent), var(--accent-dark));
}

.tile-youthfestival,
.tile-yf-registrations {
    background: linear-gradient(145deg, var(--gold), var(--accent-dark));
}

.tile-yf-categories {
    background: linear-gradient(145deg, var(--primary-mid), var(--primary-dark));
}

.tile-yf-programs {
    background: linear-gradient(145deg, var(--accent), var(--accent-dark));
}

.tile-icon {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.tile-label {
    font-size: 0.95rem;
    font-weight: 700;
}

.tile-count {
    font-size: 0.7rem;
    opacity: 0.85;
    font-weight: 500;
    margin-top: 2px;
}

.section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 16px 0 4px;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', Arial, sans-serif;
}

.account-row i {
    color: var(--muted);
    font-size: 1.05rem;
}

/* ===== Search row ===== */
.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-row input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

.btn-search {
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    padding: 0 18px;
    font-size: 1rem;
    cursor: pointer;
    font-family: 'Poppins', Arial, sans-serif;
}

.filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
}

.filter-actions .btn-search {
    padding: 10px 20px;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-family: 'Poppins', Arial, sans-serif;
    padding: 0;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-bg);
    color: var(--success-text);
    border: 1.5px solid var(--success-text);
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Poppins', Arial, sans-serif;
    margin-left: auto;
}

/* ===== Person cards (teacher/student lists) ===== */
.person-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.person-card-top {
    display: flex;
    gap: 12px;
    align-items: center;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    background: linear-gradient(145deg, var(--primary-mid), var(--primary));
}

.avatar.alt {
    background: linear-gradient(145deg, var(--accent), var(--accent-dark));
}

.person-name {
    font-weight: 700;
    font-size: 0.94rem;
    color: var(--dark);
}

.person-sub {
    font-size: 0.76rem;
    color: var(--muted);
    margin-top: 1px;
}

.person-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.chip {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(92, 100, 120, 0.08);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chip-assigned {
    background: var(--success-bg);
    color: var(--success-text);
}

.chip-unassigned {
    background: rgba(232, 169, 74, 0.16);
    color: #A06A10;
}

.chip-status-rejected {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.btn-approve {
    background: var(--success-bg);
    color: var(--success-text);
    border: none;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

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

.btn-edit,
.btn-assign,
.btn-delete {
    flex: 1;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Poppins', Arial, sans-serif;
}

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

.btn-assign {
    background: linear-gradient(90deg, var(--primary), var(--accent-dark));
    color: #fff;
}

.btn-delete {
    background: var(--danger-bg);
    border: 1.5px solid var(--danger-border);
    color: var(--danger-text);
}

.btn-table-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--primary);
    background: #fff;
    color: var(--primary);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-table-action:hover {
    background: var(--bg);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
    padding: 24px 10px;
}

/* ===== Loading overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 27, 69, 0.93);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #fff;
    font-size: 0.95rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
