:root {
    --primary: #572583;
    --primary-dark: #351052;
    --primary-light: #7c3aed;
    --primary-soft: #f3eafd;
    --accent: #c59b3c;

    --success: #16865a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    --background: #f5f3f8;
    --surface: #ffffff;
    --surface-soft: #faf9fc;

    --text: #241b2f;
    --muted: #756d7f;
    --border: #e7e0ed;

    --sidebar-width: 270px;
    --radius: 18px;
    --shadow: 0 14px 40px rgba(70, 32, 98, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================
   LOGIN
========================================= */

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.1fr) minmax(420px, 0.9fr);
    background: #ffffff;
}

.login-presentation {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 55px 65px;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(255, 255, 255, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 85%,
            rgba(198, 155, 60, 0.26),
            transparent 26%
        ),
        linear-gradient(
            145deg,
            #32104f 0%,
            #572583 52%,
            #7c3aed 100%
        );
}

.login-presentation::before,
.login-presentation::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
}

.login-presentation::before {
    width: 420px;
    height: 420px;
    top: -180px;
    right: -130px;
}

.login-presentation::after {
    width: 520px;
    height: 520px;
    bottom: -280px;
    left: -180px;
}

.university-brand,
.presentation-content,
.presentation-footer {
    position: relative;
    z-index: 2;
}

.university-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-emblem {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    font-family: Georgia, serif;
    font-size: 25px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(20, 0, 35, 0.2);
}

.brand-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.brand-text span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.presentation-content {
    max-width: 670px;
}

.presentation-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
}

.presentation-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5bd58;
    box-shadow: 0 0 0 5px rgba(229, 189, 88, 0.15);
}

.presentation-content h1 {
    max-width: 650px;
    margin: 0 0 20px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 5vw, 72px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -1.5px;
}

.presentation-content p {
    max-width: 570px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 17px;
    line-height: 1.75;
}

.presentation-footer {
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(124, 58, 237, 0.07),
            transparent 28%
        ),
        #ffffff;
}

.login-card {
    width: 100%;
    max-width: 440px;
}

.login-card-header {
    margin-bottom: 34px;
}

.login-card-header .mobile-logo {
    display: none;
}

.login-card-header h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 31px;
    letter-spacing: -0.7px;
}

.login-card-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #493d54;
    font-size: 14px;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: #95899f;
    pointer-events: none;
}

.form-control {
    width: 100%;
    min-height: 50px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    transition: 0.2s ease;
}

.input-wrapper .form-control {
    padding-left: 48px;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.form-control::placeholder {
    color: #ada4b5;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s ease;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-light)
    );
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(87, 37, 131, 0.22);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(87, 37, 131, 0.28);
}

.btn-block {
    width: 100%;
    min-height: 52px;
}

.alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

/* =========================================
   ADMIN LAYOUT
========================================= */

.admin-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: var(--sidebar-width);
    padding: 24px 16px;
    overflow-y: auto;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(255, 255, 255, 0.12),
            transparent 22%
        ),
        linear-gradient(
            180deg,
            #32104f 0%,
            #572583 55%,
            #421665 100%
        );
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 5px 10px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand .brand-emblem {
    flex: 0 0 61px;
    width: 55px;
    height: 45px;
    border-radius: 13px;
    font-size: 19px;
}

.sidebar-brand-text strong {
    display: block;
    margin-bottom: 3px;
    font-size: 15px;
}

.sidebar-brand-text span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.sidebar-section-title {
    margin: 24px 12px 10px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 47px;
    padding: 11px 13px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
}

.sidebar-link.active {
    box-shadow:
        inset 3px 0 0 #e7bc55,
        0 8px 20px rgba(22, 0, 37, 0.11);
}

.sidebar-bottom {
    margin-top: 25px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 30px;
    border-bottom: 1px solid rgba(231, 224, 237, 0.8);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
}

.topbar-title strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.topbar-title span {
    color: var(--muted);
    font-size: 12px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 11px;
}

.admin-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
}

.admin-info strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.admin-info span {
    color: var(--muted);
    font-size: 11px;
}

.page-content {
    padding: 30px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-heading h1 {
    margin: 0 0 7px;
    font-size: 29px;
    letter-spacing: -0.7px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

/* =========================================
   DASHBOARD
========================================= */

.welcome-card {
    position: relative;
    min-height: 210px;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding: 35px 38px;
    overflow: hidden;
    border-radius: 22px;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(255, 255, 255, 0.16),
            transparent 22%
        ),
        linear-gradient(
            125deg,
            #3b1359 0%,
            #642b91 62%,
            #8951d8 100%
        );
    box-shadow: 0 18px 42px rgba(65, 22, 97, 0.18);
}

.welcome-card::before,
.welcome-card::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
}

.welcome-card::before {
    width: 300px;
    height: 300px;
    top: -180px;
    right: 40px;
}

.welcome-card::after {
    width: 220px;
    height: 220px;
    right: -100px;
    bottom: -120px;
}

.welcome-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.welcome-content h2 {
    margin: 0 0 11px;
    font-size: 29px;
}

.welcome-content p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.6;
}

.welcome-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 11px;
    background: #ffffff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    position: relative;
    padding: 23px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    top: -45px;
    right: -35px;
    border-radius: 50%;
    background: var(--card-soft, var(--primary-soft));
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 19px;
}

.stat-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--card-soft, var(--primary-soft));
    color: var(--card-color, var(--primary));
}

.stat-icon svg {
    width: 23px;
    height: 23px;
}

.stat-value {
    margin-bottom: 6px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 23px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    margin: 0;
    font-size: 17px;
}

.card-body {
    padding: 23px;
}

.empty-state {
    padding: 45px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
}

.empty-state-icon svg {
    width: 29px;
    height: 29px;
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .login-page {
        display: block;
    }

    .login-presentation {
        display: none;
    }

    .login-form-side {
        min-height: 100vh;
        padding: 25px;
    }

    .login-card-header .mobile-logo {
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        margin-bottom: 25px;
        border-radius: 15px;
        background: linear-gradient(
            135deg,
            var(--primary),
            var(--primary-light)
        );
        color: #ffffff;
        font-family: Georgia, serif;
        font-size: 23px;
        font-weight: 700;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(25, 12, 36, 0.48);
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
    }
}

@media (max-width: 650px) {
    .topbar {
        min-height: 68px;
        padding: 12px 16px;
    }

    .topbar-title {
        display: none;
    }

    .admin-info {
        display: none;
    }

    .page-content {
        padding: 20px 15px;
    }

    .page-heading {
        display: block;
    }

    .page-heading h1 {
        font-size: 24px;
    }

    .welcome-card {
        min-height: 230px;
        padding: 27px 23px;
    }

    .welcome-content h2 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .login-form-side {
        align-items: flex-start;
        padding-top: 55px;
    }
}
/* =========================================
   CERTIFICATE FORM
========================================= */

.form-card {
    margin-bottom: 25px;
}

.form-card .card-header {
    align-items: flex-start;
}

.card-title-group h3 {
    margin: 0 0 6px;
}

.card-title-group p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.col-12 {
    grid-column: span 12;
}

.col-6 {
    grid-column: span 6;
}

.col-4 {
    grid-column: span 4;
}

.col-3 {
    grid-column: span 3;
}

.form-select {
    appearance: none;
    padding-right: 45px;
    background-image:
        linear-gradient(45deg, transparent 50%, #766b80 50%),
        linear-gradient(135deg, #766b80 50%, transparent 50%);
    background-position:
        calc(100% - 19px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.form-help {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.required {
    color: var(--danger);
}

.field-with-action {
    display: flex;
    align-items: stretch;
}

.field-with-action .form-control {
    border-radius: 12px 0 0 12px;
}

.field-actions {
    display: flex;
}

.field-action {
    width: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-left: 0;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    transition: 0.2s ease;
}

.field-action:last-child {
    border-radius: 0 12px 12px 0;
}

.field-action:hover {
    background: var(--primary-soft);
}

.field-action svg {
    width: 18px;
    height: 18px;
}

.form-section {
    margin-top: 27px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 19px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.form-section-icon svg {
    width: 21px;
    height: 21px;
}

.form-section-title h4 {
    margin: 0 0 4px;
    font-size: 16px;
}

.form-section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.btn-outline {
    border: 1px solid #cdb8dd;
    background: #ffffff;
    color: var(--primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.btn-danger-soft {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #fecaca;
    background: #fff6f6;
    color: var(--danger);
}

.btn-danger-soft:hover {
    background: #fee2e2;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.participant-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-soft);
}

.participant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}

.participant-number {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.participant-number > span:first-child {
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
}

.participant-title {
    width: auto;
    height: auto;
    display: inline;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
}
.participant-number > span:first-child {
    flex: 0 0 29px;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
}

.participant-title {
    width: auto;
    height: auto;
    display: inline;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
}
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 26px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.hidden {
    display: none !important;
}

.validation-summary {
    margin-bottom: 22px;
    padding: 17px 19px;
    border: 1px solid #fecaca;
    border-radius: 13px;
    background: #fef2f2;
    color: #991b1b;
}

.validation-summary strong {
    display: block;
    margin-bottom: 8px;
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.validation-summary li + li {
    margin-top: 5px;
}

.success-panel {
    margin-bottom: 22px;
    padding: 18px 20px;
    border: 1px solid #bbf7d0;
    border-radius: 13px;
    background: #f0fdf4;
    color: #166534;
}

.success-panel strong {
    display: block;
    margin-bottom: 5px;
}

@media (max-width: 850px) {
    .col-3,
    .col-4,
    .col-6 {
        grid-column: span 12;
    }

    .form-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }
}
/* =========================================
   DASHBOARD TABLE
========================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-table td {
    color: var(--text);
    font-size: 14px;
}

.admin-table tbody tr {
    transition: background 0.2s ease;
}

.admin-table tbody tr:hover {
    background: #fcfaff;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-primary-text {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-weight: 700;
}

.table-secondary-text {
    color: var(--muted);
    font-size: 12px;
}

.table-number {
    color: var(--primary);
    font-weight: 800;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #d9c9e6;
    border-radius: 9px;
    background: #ffffff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.table-action:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-completed {
    background: #e8f8f1;
    color: #08744b;
}

.status-draft {
    background: #fff6dd;
    color: #a16207;
}

.status-cancelled {
    background: #feecec;
    color: #b91c1c;
}

.card-header-action {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

.card-header-action:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .admin-table {
        min-width: 760px;
    }
}
/* =========================================
   DIRECTORY PAGES
========================================= */

.directory-layout {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.directory-form-card {
    position: sticky;
    top: 100px;
}

.directory-list-card {
    min-width: 0;
}

.directory-name {
    max-width: 430px;
}

.directory-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 12px;
}

.btn-warning-soft {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #b45309;
}

.btn-warning-soft:hover {
    background: #ffedd5;
}

.btn-success-soft {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.btn-success-soft:hover {
    background: #dcfce7;
}

.directory-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
}

.directory-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.directory-status-active {
    background: #e8f8f1;
    color: #08744b;
}

.directory-status-inactive {
    background: #f1f1f4;
    color: #6b6471;
}

.directory-empty {
    padding: 50px 20px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1050px) {
    .directory-layout {
        grid-template-columns: 1fr;
    }

    .directory-form-card {
        position: static;
    }
}
/* =========================================
   MODAL
========================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(31, 16, 43, 0.56);
    backdrop-filter: blur(5px);
}

.modal-overlay.open {
    display: flex;
}

.modal-window {
    width: 100%;
    max-width: 570px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(32, 13, 48, 0.28);
    animation: modalAppear 0.2s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(
            135deg,
            #faf7fd,
            #ffffff
        );
}

.modal-header h3 {
    margin: 0 0 6px;
    font-size: 20px;
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.modal-close:hover {
    background: #e8d9f5;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 11px;
    padding: 17px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.modal-message {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.modal-message-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.modal-message-success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

body.modal-open {
    overflow: hidden;
}

.field-action {
    padding: 0;
    font-family: inherit;
    font-size: 16px;
}
/* =========================================
   FILTERS AND PAGINATION
========================================= */

.filter-card {
    margin-bottom: 22px;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 230px 190px auto;
    gap: 13px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 9px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.pagination-link {
    min-width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.pagination-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-link.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.pagination-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.result-summary {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1050px) {
    .filter-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }
}
/* =========================================
   CERTIFICATES FILTER FIX
========================================= */

.filter-form {
    display: grid;
    grid-template-columns:
        minmax(320px, 1fr)
        minmax(210px, 260px)
        auto;
    gap: 13px;
    align-items: end;
}

.filter-form .form-group {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.filter-actions .btn {
    min-height: 50px;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .filter-form {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }
}

@media (max-width: 650px) {
    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-column: span 1;
        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }
}
/* =========================================
   PARTICIPANTS
========================================= */

.participant-filter-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    gap: 13px;
    align-items: end;
}

.participant-filter-form .form-group {
    margin-bottom: 0;
}

.participant-filter-form .filter-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.participant-filter-form .filter-actions .btn {
    min-height: 50px;
    white-space: nowrap;
}

.participant-avatar-small {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.participant-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.participant-cell-info {
    min-width: 0;
}

.participant-cell-info strong {
    display: block;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.participant-cell-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.certificate-count {
    min-width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 650px) {
    .participant-filter-form {
        grid-template-columns: 1fr;
    }

    .participant-filter-form .filter-actions {
        flex-direction: column;
    }

    .participant-filter-form .filter-actions .btn {
        width: 100%;
    }
}
/* =========================================
   PARTICIPANT VIEW
========================================= */

.participant-profile-card {
    margin-bottom: 22px;
}

.participant-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.participant-profile-avatar {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-light)
        );
    color: #ffffff;
    font-size: 27px;
    font-weight: 800;
    box-shadow: 0 12px 25px rgba(87, 37, 131, 0.22);
}

.participant-profile-info {
    min-width: 0;
}

.participant-profile-info h2 {
    margin: 0 0 7px;
    font-size: 23px;
    overflow-wrap: anywhere;
}

.participant-profile-info .participant-kz-name {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
}

.participant-profile-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.participant-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.participant-meta-badge strong {
    color: var(--text);
}

@media (max-width: 650px) {
    .participant-profile {
        align-items: flex-start;
    }

    .participant-profile-avatar {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 16px;
        font-size: 21px;
    }

    .participant-profile-info h2 {
        font-size: 19px;
    }
}