:root {
    --aast-blue: #132b61;
    --aast-magenta: #c62a73;
    --aast-navy: #061b49;
    --aast-gold: #f6ba42;
    --aast-coral: #e8563b;
    --aast-ice: #e8ebf2;
    --aast-slate: #5c727d;
    --aast-white: #ffffff;
    --aast-ink: #111827;
    --aast-muted: #6b7280;
    --aast-readable-muted: #334155;
    --aast-page: #f3f6fb;
    --aast-card-border: rgba(19, 43, 97, .14);
    --aast-soft-gold: rgba(246, 186, 66, .16);
    --aast-soft-magenta: rgba(198, 42, 115, .12);
    --aast-soft-blue: rgba(19, 43, 97, .10);
    --aast-shadow: 0 18px 45px rgba(6, 27, 73, .12);
    --aast-shadow-sm: 0 8px 22px rgba(6, 27, 73, .10);
    --aast-radius: 22px;
    --aast-radius-sm: 14px;
}

.admin-shell {
    font-family: 'Tajawal', 'Poppins', Arial, sans-serif;
    color: var(--aast-ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(246, 186, 66, .12), transparent 30%),
        radial-gradient(circle at 95% 8%, rgba(198, 42, 115, .10), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, var(--aast-page) 100%);
    border-radius: 28px;
    margin: -0.5rem -0.75rem 1rem;
    padding: 1.25rem;
    min-height: calc(100vh - 125px);
}

.admin-hero {
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background:
        linear-gradient(135deg, #061b49 0%, #132b61 62%, #8b1f58 100%);
    color: var(--aast-white);
    box-shadow: 0 22px 55px rgba(6, 27, 73, .24);
}

.admin-hero::before {
    content: "";
    position: absolute;
    inset-inline-end: -70px;
    top: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(246, 186, 66, .16);
}

.admin-hero::after {
    content: "AASTMT";
    position: absolute;
    inset-inline-start: 1.5rem;
    bottom: -.55rem;
    color: rgba(255, 255, 255, .055);
    font-family: 'Poppins', 'Tajawal', Arial, sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    letter-spacing: .05em;
    line-height: 1;
}

.admin-hero > * {
    position: relative;
    z-index: 1;
}

.admin-hero-title {
    margin: 0;
    font-weight: 900;
    letter-spacing: -.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .22);
}

.admin-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .75rem;
    border-radius: 999px;
    background: rgba(246, 186, 66, .16);
    border: 1px solid rgba(246, 186, 66, .42);
    color: var(--aast-gold);
    font-weight: 800;
    margin-bottom: .75rem;
}

.admin-hero-subtitle {
    margin: .45rem 0 0;
    color: rgba(255, 255, 255, .92);
    font-weight: 700;
    line-height: 1.8;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: flex-end;
}

.admin-card {
    border: 1px solid var(--aast-card-border) !important;
    border-radius: var(--aast-radius) !important;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(6, 27, 73, .12) !important;
    overflow: hidden;
}

.admin-card .card-header,
.admin-card-header {
    border-bottom: 1px solid rgba(19, 43, 97, .14) !important;
    background: linear-gradient(90deg, #eef3fb, #ffffff) !important;
    padding: 1rem 1.25rem !important;
}

.admin-card-title {
    margin: 0;
    color: var(--aast-blue);
    font-weight: 900;
    letter-spacing: -.01em;
}

.admin-ceremony-card {
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}

.admin-ceremony-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 55px rgba(6, 27, 73, .16) !important;
}

.admin-ceremony-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 7px;
    background: linear-gradient(180deg, var(--aast-gold), var(--aast-magenta));
}

.admin-ceremony-card.is-active::before {
    background: linear-gradient(180deg, var(--aast-gold), var(--aast-blue));
}

.admin-ceremony-card.is-inactive::before {
    background: linear-gradient(180deg, var(--aast-slate), var(--aast-ice));
}

.admin-status-pill,
.admin-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

.admin-status-pill.active {
    color: #061b49;
    background: #ffe7a6;
    border: 1px solid rgba(19, 43, 97, .12);
}

.admin-status-pill.inactive {
    color: #334155;
    background: #dbe3ea;
    border: 1px solid rgba(51, 65, 85, .18);
}

.admin-feature-pill {
    color: var(--aast-navy);
    background: var(--aast-ice);
    margin: .15rem;
    border: 1px solid rgba(19, 43, 97, .10);
}

.admin-feature-pill.gold { background: #ffe7a6; color: #061b49; }
.admin-feature-pill.magenta { background: #f7d8e8; color: #8b1f58; }
.admin-feature-pill.blue { background: #dce7f9; color: #061b49; }
.admin-feature-pill.coral { background: #ffd9d0; color: #9f2e1c; }
.admin-feature-pill.slate { background: #dbe3ea; color: #243746; }

.admin-btn {
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    padding: .58rem 1.05rem;
    box-shadow: 0 8px 18px rgba(6, 27, 73, .12);
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.admin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(6, 27, 73, .18);
}

.admin-btn-primary {
    color: var(--aast-white) !important;
    background: linear-gradient(135deg, var(--aast-blue), var(--aast-navy));
}

.admin-btn-gold {
    color: var(--aast-navy) !important;
    background: linear-gradient(135deg, var(--aast-gold), #ffd878);
}

.admin-btn-magenta {
    color: var(--aast-white) !important;
    background: linear-gradient(135deg, var(--aast-magenta), #df5b96);
}

.admin-btn-coral {
    color: var(--aast-white) !important;
    background: linear-gradient(135deg, var(--aast-coral), #ff846f);
}

.admin-btn-outline {
    color: var(--aast-blue) !important;
    background: var(--aast-white);
    border: 1px solid rgba(19, 43, 97, .14) !important;
}

.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: .45rem;
}

.admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 14px !important;
    border: 1px solid rgba(19, 43, 97, .10) !important;
    background: #fff !important;
    color: var(--aast-blue) !important;
    box-shadow: 0 6px 14px rgba(6, 27, 73, .08);
}

.admin-icon-btn:hover {
    color: var(--aast-white) !important;
    background: var(--aast-blue) !important;
}

.admin-icon-btn.gold:hover { background: var(--aast-gold) !important; color: var(--aast-navy) !important; }
.admin-icon-btn.magenta:hover { background: var(--aast-magenta) !important; color: #fff !important; }
.admin-icon-btn.coral:hover { background: var(--aast-coral) !important; color: #fff !important; }
.admin-icon-btn.slate:hover { background: var(--aast-slate) !important; color: #fff !important; }

.admin-form label,
.admin-card label {
    color: var(--aast-blue);
    font-weight: 900;
}

.admin-form .form-control,
.admin-card .form-control,
.admin-card .custom-select {
    border-radius: 14px;
    border: 1px solid rgba(19, 43, 97, .14);
    min-height: 44px;
    box-shadow: none;
}

.admin-form .form-control:focus,
.admin-card .form-control:focus {
    border-color: var(--aast-gold);
    box-shadow: 0 0 0 .2rem rgba(246, 186, 66, .18);
}

.admin-switch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: .75rem;
}

.admin-switch-card {
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(19, 43, 97, .08);
    padding: .85rem 1rem;
}

.admin-stat {
    border: 0;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(19, 43, 97, .12);
    box-shadow: 0 10px 24px rgba(6, 27, 73, .10);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.admin-stat::after {
    content: "";
    position: absolute;
    inset-inline-end: -28px;
    bottom: -32px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(246, 186, 66, .12);
}

.admin-stat-label {
    color: var(--aast-readable-muted);
    font-weight: 800;
    font-size: .78rem;
    text-transform: uppercase;
}

.admin-stat-value {
    color: var(--aast-navy);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

.admin-table {
    border-collapse: separate;
    border-spacing: 0 .55rem;
}

.admin-table thead th {
    border: 0 !important;
    color: var(--aast-white);
    background: var(--aast-navy);
    font-weight: 900;
}

.admin-table tbody tr {
    background: #fff;
    box-shadow: 0 5px 14px rgba(6, 27, 73, .06);
}

.admin-table tbody td {
    border-top: 0 !important;
    vertical-align: middle;
}

.admin-quill-wrapper .ql-toolbar.ql-snow {
    border-radius: 18px 18px 0 0;
    border-color: rgba(19, 43, 97, .14);
    background: #fff;
    direction: ltr;
    text-align: left;
    min-height: 48px;
}

.admin-quill-wrapper .ql-container.ql-snow {
    border-radius: 0 0 18px 18px;
    border-color: rgba(19, 43, 97, .14);
    background: #fff;
    font-family: 'Tajawal', Arial, sans-serif;
}

.admin-quill-editor {
    min-height: 420px;
    background: #fff;
}

.admin-quill-wrapper .ql-editor {
    min-height: 420px;
    font-size: 1rem;
    line-height: 1.8;
    direction: rtl;
    text-align: right;
    color: #111827;
}

.admin-quill-wrapper .ql-editor ol,
.admin-quill-wrapper .ql-editor ul,
.ceremony-content-preview ol,
.ceremony-content-preview ul {
    padding-inline-start: 2rem;
    padding-inline-end: 2rem;
    margin: .75rem 0;
}

.admin-quill-wrapper .ql-editor ol,
.ceremony-content-preview ol {
    list-style-position: outside;
    list-style-type: decimal;
}

.admin-quill-wrapper .ql-editor ul,
.ceremony-content-preview ul {
    list-style-position: outside;
    list-style-type: disc;
}

.admin-quill-wrapper .ql-editor li,
.ceremony-content-preview li {
    padding-inline-start: .35rem;
    margin-bottom: .35rem;
}

.admin-html-editor {
    min-height: 420px;
    direction: ltr;
    text-align: left;
    font-family: Consolas, 'Courier New', monospace;
    font-size: .95rem;
    line-height: 1.7;
    color: #111827;
    background: #f8fafc;
    border: 1px solid rgba(19, 43, 97, .14);
    border-radius: 18px;
}

.admin-editor-tools .admin-btn.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--aast-magenta), var(--aast-blue));
}

.ceremony-content-preview-body {
    margin: 0;
    background: #f3f6fb;
    color: #111827;
    font-family: 'Tajawal', Arial, sans-serif;
}

.ceremony-content-preview {
    max-width: 1100px;
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    padding: 2rem;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(6, 27, 73, .12);
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

.admin-quill-wrapper .ql-editor.ql-blank::before {
    right: 15px;
    left: auto;
    color: #64748b;
    font-style: normal;
}

.admin-super-ribbon {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--aast-navy);
    background: linear-gradient(135deg, var(--aast-gold), #fff0bd);
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 900;
}

.admin-section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--aast-blue);
    font-weight: 900;
    margin: 1rem 0 .85rem;
}

.admin-section-title::before {
    content: "";
    width: 10px;
    height: 28px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--aast-gold), var(--aast-magenta));
}

@media (max-width: 768px) {
    .admin-shell {
        border-radius: 18px;
        margin: -.75rem -1rem 0;
        padding: .85rem;
    }

    .admin-hero {
        border-radius: 22px;
        padding: 1rem;
    }

    .admin-toolbar {
        justify-content: stretch;
    }

    .admin-toolbar .admin-btn,
    .admin-toolbar .btn {
        width: 100%;
    }
}

.admin-swal-title {
    color: var(--aast-navy) !important;
    font-family: 'Tajawal', 'Poppins', Arial, sans-serif !important;
    font-weight: 900 !important;
}

.admin-swal-content {
    color: var(--aast-slate) !important;
    font-family: 'Tajawal', 'Poppins', Arial, sans-serif !important;
}

.admin-swal-confirm {
    border-radius: 999px !important;
    font-family: 'Tajawal', 'Poppins', Arial, sans-serif !important;
    font-weight: 900 !important;
    padding-inline: 1.5rem !important;
}

.ceremony-control-shell {
    background:
        radial-gradient(circle at 18% 12%, rgba(246, 186, 66, .12), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(198, 42, 115, .08), transparent 34%),
        linear-gradient(145deg, #f8fafc 0%, #eef3fb 52%, #f7f9fd 100%);
}

.ceremony-control-hero {
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 28px 65px rgba(6, 27, 73, .26);
}

.shiny-stat {
    border: 1px solid rgba(19, 43, 97, .14);
    background: #ffffff;
    backdrop-filter: none;
}

.ceremony-action-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-height: 172px;
    padding: 1.35rem;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 24px;
    color: #fff;
    text-align: right;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(6, 27, 73, .18);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ceremony-action-card::before {
    content: "";
    position: absolute;
    inset-inline-end: -42px;
    top: -42px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
}

.ceremony-action-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 44%);
    pointer-events: none;
}

.ceremony-action-card:hover {
    transform: translateY(-7px) scale(1.01);
    box-shadow: 0 26px 60px rgba(6, 27, 73, .28);
}

.ceremony-action-card.blue { background: linear-gradient(135deg, #132b61, #061b49); }
.ceremony-action-card.magenta { background: linear-gradient(135deg, #a92161, #6f153f); }
.ceremony-action-card.gold { background: linear-gradient(135deg, #f6ba42, #d29313); color: #061b49; border-color: rgba(6, 27, 73, .12); }
.ceremony-action-card.coral { background: linear-gradient(135deg, #e8563b, #a93420); }
.ceremony-action-card.slate { background: linear-gradient(135deg, #5c727d, #2f4652); }

.ceremony-action-icon {
    display: inline-flex;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    font-size: 1.45rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.ceremony-action-title {
    font-size: 1.16rem;
    font-weight: 900;
    position: relative;
    z-index: 1;
}

.ceremony-action-desc {
    margin-top: .45rem;
    opacity: .96;
    font-size: .93rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.ceremony-info-panel .card-body {
    padding: 1.25rem;
}

.ceremony-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px dashed rgba(19, 43, 97, .14);
}

.ceremony-info-row:last-child {
    border-bottom: 0;
}

.ceremony-info-row span {
    color: var(--aast-readable-muted);
    font-weight: 800;
}

.ceremony-info-row strong {
    color: var(--aast-blue);
    font-weight: 900;
    text-align: left;
}

.ceremony-chip-list,
.ceremony-user-list {
    display: grid;
    gap: .7rem;
}

.ceremony-chip {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    padding: .75rem .9rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef3fb, #ffffff);
    border: 1px solid rgba(19, 43, 97, .12);
    color: var(--aast-blue);
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(6, 27, 73, .08);
}

.ceremony-chip small {
    color: var(--aast-readable-muted);
    font-weight: 800;
}

.ceremony-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(19, 43, 97, .12);
}

.ceremony-user-item strong {
    color: var(--aast-blue);
    font-weight: 900;
}

.ceremony-empty-state {
    padding: 1.5rem;
    border-radius: 18px;
    color: var(--aast-readable-muted);
    background: #f8fafc;
    border: 1px dashed rgba(19, 43, 97, .18);
    text-align: center;
    font-weight: 800;
}

.compact-admin-form label {
    color: var(--aast-blue);
    font-weight: 800;
    font-size: .85rem;
}

.compact-admin-form .form-control {
    border-radius: 12px;
    border-color: rgba(19, 43, 97, .16);
    min-height: 40px;
}

.compact-switch-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .55rem;
}

.compact-switch-grid .admin-switch-card {
    padding: .65rem .75rem;
}

.ceremony-faculty-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .65rem;
    max-height: 420px;
    overflow-y: auto;
    padding-inline-end: .35rem;
}

.ceremony-faculty-picker .admin-switch-card {
    min-height: 76px;
}

.seating-management-shell {
    direction: rtl;
}

.seating-hero .admin-hero-subtitle,
.seating-hero .admin-hero-title {
    direction: rtl;
    text-align: right;
}

.seating-zone-card {
    overflow: visible !important;
}

.seating-zone-card.disabled-zone {
    opacity: .72;
}

.seating-zone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.seating-zone-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.seating-zone-meta span {
    padding: .25rem .55rem;
    border-radius: 999px;
    color: var(--aast-blue);
    background: #eef3fb;
    border: 1px solid rgba(19, 43, 97, .12);
    font-size: .78rem;
    font-weight: 800;
}

.seating-grid {
    display: grid;
    gap: .75rem;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: .25rem;
    direction: ltr;
}

.seating-cell {
    position: relative;
    min-height: 148px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(19, 43, 97, .12);
    padding: .55rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seating-cell.empty {
    border-style: dashed;
    background: linear-gradient(135deg, #f8fafc, #eef3fb);
}

.seating-cell-position {
    position: absolute;
    top: .4rem;
    left: .5rem;
    color: #64748b;
    font-size: .7rem;
    font-weight: 800;
    direction: ltr;
}

.seating-empty-add {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    width: 100%;
    min-height: 96px;
    border: 0;
    border-radius: 16px;
    color: var(--aast-blue);
    background: rgba(255, 255, 255, .72);
    font-weight: 900;
    cursor: pointer;
}

.seating-empty-add:hover {
    background: #fff;
    box-shadow: 0 10px 22px rgba(6, 27, 73, .12);
}

.seating-table-card {
    width: 100%;
    min-height: 128px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(13, 148, 136, .25);
    box-shadow: 0 10px 24px rgba(6, 27, 73, .10);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.7rem .35rem .6rem;
}

.seating-table-card.disabled-table {
    filter: grayscale(.85);
    opacity: .75;
    border-color: rgba(71, 85, 105, .3);
}

.seating-table-actions {
    position: absolute;
    top: .35rem;
    right: .35rem;
    display: flex;
    gap: .2rem;
    z-index: 2;
}

.seating-table-actions .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 9px;
    box-shadow: 0 4px 10px rgba(6, 27, 73, .10);
}

.seating-table-info {
    margin-top: .25rem;
    text-align: center;
    color: var(--aast-blue);
    direction: rtl;
}

.seating-table-info strong,
.seating-table-info small {
    display: block;
}

.seating-table-info small {
    color: var(--aast-readable-muted);
    font-weight: 700;
    font-size: .72rem;
}

.admin-modal-backdrop {
    background: rgba(6, 27, 73, .55);
}

.admin-modal-card {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(6, 27, 73, .28);
}

.admin-modal-card .modal-header {
    border-bottom: 1px solid rgba(19, 43, 97, .12);
    background: linear-gradient(90deg, #eef3fb, #ffffff);
    border-radius: 24px 24px 0 0;
}

.duplicate-options-grid .admin-switch-card {
    min-height: 96px;
    align-items: flex-start;
}

.duplicate-options-grid .admin-switch-card small {
    display: block;
    margin-top: .35rem;
    color: var(--aast-readable-muted);
    font-weight: 700;
    line-height: 1.5;
}

.duplicate-options-grid input:disabled + strong,
.duplicate-options-grid input:disabled ~ small {
    opacity: .55;
}

.shiny-admin-panel {
    border: 1px solid rgba(19, 43, 97, .16) !important;
    box-shadow: 0 18px 44px rgba(6, 27, 73, .14) !important;
}
