:root {
    --sidebar-width: 270px;
    --brand: #0f4c5c;
    --brand-dark: #0b3641;
    --accent: #e36414;
    --bg: #f4f7f8;
}

body.app-body {
    background: var(--bg);
    font-family: "Segoe UI", system-ui, sans-serif;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-dark), var(--brand));
    min-height: 100vh;
    position: fixed;
    color: #fff;
    z-index: 1030;
}

.sidebar .brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar .brand small {
    display: block;
    opacity: .75;
    font-size: .75rem;
}

.sidebar .nav-link {
    color: rgba(255,255,255,.82);
    border-radius: .5rem;
    padding: .45rem .8rem;
    margin: .1rem .7rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.sidebar .nav-section {
    padding: .9rem 1.3rem .2rem;
    font-size: .7rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .55;
}

.main-wrap {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e6ecee;
}

.stat-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(15, 76, 92, .06);
}

.stat-card .icon {
    width: 42px;
    height: 42px;
    border-radius: .8rem;
    display: grid;
    place-items: center;
    background: #e8f2f4;
    color: var(--brand);
}

.card-soft {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(15, 76, 92, .06);
}

.table thead th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #5b6b70;
}

.member-photo,
.candidate-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: .6rem;
    background: #e8f2f4;
}

.member-photo-lg {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 1rem;
}

.login-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0b3641, #178ca6);
}

.login-card {
    border: 0;
    border-radius: 1.2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
}

.login-logo {
    width: 148px;
    height: 148px;
    object-fit: contain;
    border-radius: 50%;
    background: #000;
    padding: 8px;
}

.login-org {
    font-weight: 700;
    margin-top: 12px;
    color: #0b3641;
}

.login-tagline {
    font-size: 12px;
    color: #6b7a80;
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 50%;
    background: #000;
    margin-bottom: 8px;
    display: block;
}

.foomka-watermark,
.print-watermark {
    position: fixed;
    inset: 12% 10% 18%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: .08;
    pointer-events: none;
    z-index: 0;
}

.foomka-sheet,
.print-body > header,
.print-body > .no-print,
.print-body > table,
.print-body > script {
    position: relative;
    z-index: 1;
}

.notice-manual {
    background: #fff6ee;
    border: 1px solid #f3d2b5;
    color: #7a3e0b;
    border-radius: .8rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.show {
        transform: none;
    }
    .main-wrap {
        margin-left: 0;
    }
}

@page {
    size: A4;
    margin: 12mm;
}

.print-body {
    background: #fff;
    color: #111;
}

.print-header {
    text-align: center;
    border-bottom: 2px solid #111;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.print-header img {
    max-height: 88px;
}

.register-table td,
.register-table th {
    border: 1px solid #222 !important;
    vertical-align: middle;
}

.signature-box {
    min-width: 160px;
    height: 36px;
}

.ballot-page {
    page-break-after: always;
    border: 2px solid #111;
    padding: 24px;
    min-height: 240mm;
}

.ballot-page:last-child {
    page-break-after: auto;
}

.ballot-candidate {
    border: 1px solid #333;
    padding: 12px;
    margin-bottom: 12px;
}

.ballot-check {
    width: 28px;
    height: 28px;
    border: 2px solid #111;
    display: inline-block;
    margin-right: 12px;
}

.letter-sign {
    min-height: 140px;
}

.letter-line {
    border-bottom: 1px solid #111;
    height: 48px;
    margin: 8px 0 6px;
}

.acceptance-letter {
    max-width: 190mm;
    margin: 0 auto;
}

.foomka-body {
    background: #e8eef0;
    min-height: 100vh;
    padding: 20px 12px 40px;
}

.foomka-toolbar {
    max-width: 210mm;
    margin: 0 auto 16px;
    display: flex;
    gap: 8px;
}

.foomka-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    color: #12232b;
    padding: 14mm 16mm 16mm;
    box-shadow: 0 18px 50px rgba(15, 76, 92, .16);
    box-sizing: border-box;
    font-family: "Times New Roman", "Noto Naskh Arabic", serif;
}

.foomka-head {
    display: grid;
    grid-template-columns: 78px 1fr 150px;
    gap: 16px;
    align-items: center;
    border-bottom: 3px solid #0f4c5c;
    padding-bottom: 14px;
    margin-bottom: 18px;
    position: relative;
}

.foomka-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 3px;
    background: #c9a227;
}

.foomka-crest img,
.foomka-seal {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.foomka-seal {
    border: 3px solid #0f4c5c;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #0f4c5c;
    font-family: "Segoe UI", sans-serif;
    background: #f4f7f8;
}

.foomka-titles {
    text-align: center;
}

.foomka-state {
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 12px;
    color: #5b6b70;
}

.foomka-org {
    font-size: 20px;
    font-weight: 700;
    color: #0b3641;
    line-height: 1.2;
}

.foomka-titles h1 {
    font-size: 22px;
    margin: 6px 0 2px;
    color: #0f4c5c;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.foomka-sub {
    margin: 0;
    font-size: 12px;
    color: #6b7a80;
}

.foomka-meta {
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    text-align: right;
}

.foomka-meta span {
    display: block;
    color: #6b7a80;
    font-size: 11px;
}

.foomka-main {
    display: grid;
    grid-template-columns: 1fr 42mm;
    gap: 18px;
    margin-top: 22px;
}

.foomka-row {
    border-bottom: 1px solid #c5d0d4;
    padding: 8px 0 6px;
}

.foomka-row label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #0f4c5c;
    font-family: "Segoe UI", sans-serif;
    font-weight: 700;
}

.foomka-row div {
    min-height: 26px;
    font-size: 17px;
    padding-top: 2px;
}

.foomka-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

.foomka-photo-frame {
    width: 42mm;
    height: 50mm;
    border: 2px solid #0f4c5c;
    background: #f4f7f8;
    overflow: hidden;
    display: grid;
    place-items: center;
    text-align: center;
    color: #7a8a90;
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
}

.foomka-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foomka-photo-cap {
    text-align: center;
    font-size: 12px;
    margin-top: 6px;
    font-family: "Segoe UI", sans-serif;
    color: #0f4c5c;
    font-weight: 700;
}

.foomka-note {
    margin: 22px 0 0;
    padding: 10px 12px;
    background: #f7f3e8;
    border-left: 4px solid #c9a227;
    font-size: 14px;
}

.foomka-signs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 36px;
}

.foomka-sign-title {
    font-weight: 700;
    color: #0f4c5c;
    font-family: "Segoe UI", sans-serif;
    text-transform: uppercase;
    font-size: 13px;
}

.foomka-sign-name {
    min-height: 22px;
    margin-top: 8px;
    font-size: 16px;
}

.foomka-sign-line {
    border-bottom: 1px solid #12232b;
    height: 46px;
}

.foomka-sign-hint,
.foomka-sign-date {
    font-size: 12px;
    color: #5b6b70;
    margin-top: 6px;
    font-family: "Segoe UI", sans-serif;
}

.foomka-candidate {
    position: relative;
}

.musharax-ribbon {
    position: absolute;
    top: 18px;
    right: -8px;
    background: linear-gradient(135deg, #8b1e3f, #c9a227);
    color: #fff;
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 7px 18px;
    box-shadow: 0 8px 16px rgba(139, 30, 63, .25);
}

.musharax-ballot {
    border: 2px solid #8b1e3f;
    padding: 6px 8px;
    margin-bottom: 8px;
    text-align: center;
    background: #fff8f3;
}

.musharax-ballot strong {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #8b1e3f;
}

.foomka-row.highlight {
    background: #fff8ee;
    padding-left: 8px;
    padding-right: 8px;
    border-bottom: 2px solid #c9a227;
}

.foomka-row.highlight div {
    font-weight: 700;
    color: #8b1e3f;
}

.musharax-frame {
    border-color: #8b1e3f;
}

.musharax-note {
    background: #fff6f0;
    border-left-color: #8b1e3f;
}

@media print {
    .foomka-watermark,
    .print-watermark {
        position: fixed;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        opacity: .09;
    }
    .no-print {
        display: none !important;
    }
    .ballot-page,
    .print-sheet,
    .foomka-sheet {
        box-shadow: none;
    }
    .foomka-body {
        background: #fff;
        padding: 0;
    }
    .foomka-sheet {
        width: auto;
        min-height: auto;
        padding: 0;
    }
}
