:root {
    color-scheme: light;
    --navy: #111723;
    --navy-soft: #192337;
    --blue: #789bd9;
    --blue-dark: #5479bd;
    --blue-pale: #edf3ff;
    --ink: #202a3b;
    --muted: #737f91;
    --line: #e4e9f1;
    --surface: #ffffff;
    --canvas: #f4f6fa;
    --danger: #b6424c;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 18px;
    background:
        radial-gradient(ellipse at 100% 0, rgba(54, 84, 151, .4), transparent 38%),
        #10131b;
}

.login-card {
    zoom: .77;
    width: min(100%, 670px);
    padding: clamp(15px, 3.5vw, 35px) clamp(30px, 7vw, 70px);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 30px;
    background: #17191f;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
    color: #f6f8fc;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.035em;
}

.brand-slogan {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}




.login-heading {
    margin: 0 0 12px;
}

.login-card .login-banner {
    margin: 0 0 13px;
    border-color: transparent;
}

.login-heading h1 {
    margin: 0 0 8px;
    color: #f6f8fc;
    font-size: 20px;
}

.login-heading p {
    margin: 0;
    color: #a6afbf;
    font-size: 14px;
    line-height: 1.6;
}

.stack-form,
.stack-form label {
    display: grid;
}

.stack-form {
    gap: 11px;
}

.stack-form label,
.search-form > label,
.label-like {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.login-card .stack-form label {
    margin-top: 2px;
    color: #a6b7d3;
}

.stack-form input,
.search-row input,
.user-create-form input,
.password-update-form input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: var(--ink);
    padding: 0 16px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.login-card .stack-form input {
    min-height: 66px;
    border-color: transparent;
    border-radius: 13px;
    background: #eaf0fc;
    color: #17243a;
    font-size: 17px;
}

input:focus {
    border-color: var(--blue) !important;
    box-shadow: 0 0 0 3px rgba(120, 155, 217, .19);
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    padding: 0 16px;
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--blue);
    color: #fff;
}

.button-primary:hover {
    background: var(--blue-dark);
}

.button-wide {
    min-height: 60px;
    margin-top: 5px;
    border-radius: 13px;
    font-size: 17px;
}

.button-secondary {
    border-color: #dbe4f2;
    background: #f3f6fb;
    color: #405774;
}

.button-secondary:hover {
    background: #e9eff9;
}

.button-danger {
    border-color: #f0d9dc;
    background: #fff8f8;
    color: var(--danger);
}

.button-danger:hover:not(:disabled) {
    background: #fff0f1;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.app-page {
    min-height: 100vh;
}

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    padding: 12px clamp(18px, 4vw, 54px);
}

.topbar .brand-title {
    font-size: 21px;
}

.topbar .brand-slogan {
    font-size: 10px;
}

.topbar-account {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-account form {
    margin: 0;
}

.session-dot {
    width: 12px;
    height: 12px;
    flex: none;
    border-radius: 50%;
    background: var(--blue-dark);
    box-shadow: 0 0 0 4px var(--blue-pale);
}

.button-logout {
    min-height: 38px;
    border-color: var(--line);
    background: #fff;
    color: #49576a;
}

.button-logout:hover {
    background: #f7f9fc;
}

.member-shell {
    display: grid;
    min-height: calc(100vh - 76px);
    place-items: start center;
    padding: clamp(16px, 3vh, 24px) 18px 38px;
}

.search-main {
    width: 100%;
}

.search-column {
    width: min(100%, 590px);
    margin: 0 auto;
}

.campaign-banner {
    overflow: hidden;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(32, 50, 80, .045);
}

.campaign-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.campaign-banner-link {
    display: block;
}

.campaign-banner-link:focus-visible {
    outline: 3px solid var(--blue-dark);
    outline-offset: -3px;
}

.search-panel,
.results-section,
.user-create-card,
.user-list-section {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(32, 50, 80, .045);
}

.search-panel {
    padding: clamp(22px, 5vw, 34px);
}

.section-heading {
    margin-bottom: 27px;
}

.eyebrow {
    color: var(--blue-dark);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
}

.section-heading h1,
.admin-page-heading h1 {
    margin: 7px 0 7px;
    color: var(--navy);
    font-size: 27px;
    letter-spacing: -.04em;
}

.section-heading p,
.admin-page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.search-form {
    display: grid;
    gap: 10px;
}

.search-form > label,
.label-like {
    color: #536175;
}

.search-row {
    display: flex;
    align-items: stretch;
    gap: 9px;
}

.search-row input {
    min-width: 0;
    min-height: 50px;
    border-radius: 11px;
    font-size: 14px;
}

.search-row .button {
    min-width: 76px;
    min-height: 50px;
}

.search-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #99a3b1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.search-divider::before,
.search-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.representative-search {
    display: grid;
    gap: 10px;
}

.results-section {
    margin-top: 20px;
    padding: clamp(20px, 4vw, 28px);
}

.result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    border: 1px solid #dbe6f8;
    border-radius: 11px;
    background: #f1f6ff;
    color: #52647f;
    font-size: 13px;
    line-height: 1.5;
    padding: 12px 14px;
}

.clear-search-form {
    flex: 0 0 auto;
}

.clear-search-form .button {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
}

.result-summary strong {
    color: #3e64a5;
    font-size: 15px;
}

.results-heading,
.user-list-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.results-heading h2,
.user-list-heading h2 {
    margin: 7px 0 0;
    color: var(--navy);
    font-size: 18px;
    letter-spacing: -.025em;
}

.result-count,
.user-list-heading > span {
    flex: 0 0 auto;
    border-radius: 20px;
    background: var(--blue-pale);
    color: #526e9f;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 10px;
}

.result-list {
    display: grid;
    gap: 11px;
}

.result-card {
    container-type: inline-size;
    min-width: 0;
    border: 1px solid #e7ebf2;
    border-radius: 13px;
    background: #fff;
    padding: 17px;
}

.voting-warning {
    margin: 0 0 12px;
    border: 1px solid #f0c6c8;
    border-radius: 9px;
    background: #fff0f0;
    color: #a51f2b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .045em;
    padding: 9px 11px;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.result-header h3 {
    min-width: 0;
}

.group-badge {
    flex: none;
    color: var(--blue-dark);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.result-card h3 {
    margin: 0;
    color: #26344b;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.search-highlight {
    border-radius: 3px;
    background: #fff0a8;
    box-decoration-break: clone;
    color: inherit;
    padding: 0 2px;
    -webkit-box-decoration-break: clone;
}

/* Labels share the first column, so every value starts where "Oda sicil no" does. */
.result-details {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: baseline;
    row-gap: 11px;
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

.result-detail {
    display: contents;
}

.result-details dl {
    margin: 0;
}

.result-details dt {
    color: var(--muted);
}

.result-details dt::after {
    content: ":";
}

.result-detail dt,
.registry-trade {
    padding-right: 18px;
}

.result-details dd {
    min-width: 0;
    margin: 0;
    color: #344359;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/*
 * Bottom row: Ticaret sicil no | Oda sicil no | Sandık No on one line.
 * At full size the row needs ~495px, the desktop card's content width. Every size below is
 * its full-size value divided by ~5.05px (1cqi at a 505px card), so the row shrinks
 * proportionally with the card instead of wrapping. Only very narrow phones hit the minimums
 * and wrap Sandık No onto its own line.
 */
.registry-trade,
.registry-group {
    align-self: stretch;
    border-top: 1px solid #f0f2f6;
    padding-top: 11px;
    font-size: clamp(8px, 2.38cqi, 12px);
}

.result-details .registry-trade {
    padding-right: clamp(6px, 3.56cqi, 18px);
}

.registry-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px clamp(10px, 10.1cqi, 51px);
}

/* Each label stays together with its number; only whole items wrap. */
.registry-item {
    display: flex;
    align-items: center;
    gap: .4em;
    white-space: nowrap;
}

.registry-item dd {
    font-weight: 700;
}

/* Tight line boxes so the small sicil numbers center on the larger Sandık No. */
.registry-item dt,
.registry-item dd {
    line-height: 1.2;
}

.registry-item:not(.registry-ballot) dt,
.registry-item:not(.registry-ballot) dd {
    position: relative;
    top: .17em;
}

.registry-ballot dt,
.result-details .registry-ballot dd {
    color: var(--blue-dark);
    font-size: clamp(12px, 3.76cqi, 19px);
    font-weight: 800;
}

/* Keeps room for the 4-digit number before ballot boxes are assigned. */
.registry-ballot dd {
    min-width: 4ch;
}

/*
 * Phones: too narrow to keep one readable line, so Sandık No gets its own line at a
 * readable size and Ticaret sicil no stays level with Oda sicil no.
 */
@container (max-width: 335px) {
    .registry-trade,
    .registry-group {
        font-size: 11px;
    }

    .registry-ballot {
        flex-basis: 100%;
    }

    .registry-ballot dt,
    .result-details .registry-ballot dd {
        font-size: min(16px, 4.6cqi);
    }

    .registry-trade {
        align-items: flex-start;
    }
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 9px;
    border: 1px dashed #dce3ef;
    border-radius: 13px;
    color: var(--muted);
    padding: 30px 18px;
    text-align: center;
}

.empty-state strong {
    color: #344359;
    font-size: 14px;
}

.empty-state > span:last-child {
    max-width: 360px;
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.empty-icon {
    color: var(--blue);
    font-size: 28px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 12px;
}

.pagination a {
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.pagination a:hover {
    text-decoration: underline;
}


.notice {
    margin-bottom: 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.55;
    padding: 12px 14px;
}

.notice-success {
    border-color: #d3eadb;
    background: #f0faf3;
    color: #31704b;
}

.notice-error {
    border-color: #f1d6d8;
    background: #fff4f4;
    color: #a03b43;
}

.admin-layout {
    background: #f3f5f9;
}

.admin-shell {
    display: grid;
    min-height: calc(100vh - 76px);
    grid-template-columns: 228px minmax(0, 1fr);
}

.sidebar {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-right: 1px solid var(--line);
    background: #fff;
    padding: 30px 16px;
}

.sidebar-label {
    margin: 0 12px 12px;
    color: #9aa4b1;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.side-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    color: #606d7e;
    font-size: 13px;
    font-weight: 650;
    padding: 0 12px;
    text-decoration: none;
}

.side-link:hover {
    background: #f7f9fc;
    color: var(--navy);
}

.side-link.active {
    background: #edf3ff;
    color: #4e72b3;
}

.side-icon {
    width: 18px;
    color: var(--blue-dark);
    font-size: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 10px 0;
    color: #687487;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.7;
}

.sidebar-footer span {
    color: #9aa4b1;
    font-size: 10px;
    font-weight: 400;
}

.admin-content {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: clamp(25px, 4vw, 46px);
}

.admin-page-heading {
    margin-bottom: 25px;
}

.admin-page-heading h1 {
    font-size: 25px;
}

.user-create-card,
.user-list-section {
    padding: clamp(18px, 3vw, 25px);
}

.user-create-card h2 {
    margin: 0 0 19px;
    color: var(--navy);
    font-size: 16px;
}

.user-create-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.user-create-form label {
    display: grid;
    gap: 7px;
    color: #657286;
    font-size: 11px;
    font-weight: 650;
}

.user-create-form input,
.password-update-form input {
    min-height: 42px;
    border-radius: 9px;
    font-size: 12px;
    padding: 0 11px;
}

.user-create-form .button {
    min-height: 42px;
    white-space: nowrap;
}

.user-list-section {
    margin-top: 18px;
}

.user-list-heading {
    align-items: center;
}

.user-list-heading h2 {
    margin: 0;
    font-size: 16px;
}

.user-list {
    display: grid;
    gap: 10px;
}

.user-card {
    display: grid;
    grid-template-columns: minmax(135px, .7fr) minmax(300px, 1.5fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    padding: 12px;
}

.user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-identity > span:last-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.user-identity strong {
    overflow: hidden;
    color: #2d3a4d;
    font-size: 12px;
    text-overflow: ellipsis;
}

.user-identity small {
    color: #8993a2;
    font-size: 10px;
}

.user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-pale);
    color: #577bb8;
    font-size: 13px;
    font-weight: 800;
}

.password-update-form {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(100px, 1fr) auto;
    gap: 7px;
}

.password-update-form .button {
    min-height: 42px;
    padding: 0 11px;
    white-space: nowrap;
}

.delete-user-form {
    margin: 0;
}

.delete-user-form .button {
    min-height: 38px;
    padding: 0 11px;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

@media (max-width: 1000px) {
    .user-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-card {
        grid-template-columns: minmax(130px, .7fr) minmax(0, 1.5fr);
    }

    .delete-user-form {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 720px) {
    .topbar {
        min-height: 66px;
        padding: 10px 14px;
    }

    .topbar .brand {
        min-width: 0;
    }

    .topbar .brand-title {
        font-size: clamp(13px, 4vw, 16px);
    }

    .topbar .brand-slogan {
        font-size: 9px;
    }

    .topbar-account {
        gap: 8px;
    }

    .button-logout {
        min-height: 34px;
        font-size: 11px;
        padding: 0 10px;
    }

    .member-shell {
        min-height: calc(100vh - 66px);
        padding: 25px 14px 32px;
    }

    .admin-shell {
        min-height: calc(100vh - 66px);
        grid-template-columns: 1fr;
        align-content: start;
    }

    .sidebar {
        flex-direction: row;
        align-items: center;
        gap: 5px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 9px 12px;
    }

    .sidebar-label,
    .sidebar-footer {
        display: none;
    }

    .side-link {
        min-height: 40px;
        gap: 7px;
        font-size: 11px;
        padding: 0 10px;
    }

    .side-icon {
        font-size: 15px;
    }

    .admin-content {
        padding: 23px 14px;
    }

    .user-create-form {
        grid-template-columns: 1fr;
    }

    .user-create-form .button {
        justify-self: start;
    }

    .user-card {
        grid-template-columns: 1fr auto;
        gap: 11px;
    }

    .user-identity {
        grid-column: 1 / -1;
    }

    .password-update-form {
        grid-template-columns: 1fr 1fr;
    }

    .password-update-form .button {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .delete-user-form {
        grid-column: auto;
        align-self: end;
    }

    .delete-user-form .button {
        font-size: 11px;
    }
}

@media (max-width: 390px) {
    .topbar .brand-title {
        font-size: 14px;
    }

    .topbar-account {
        gap: 6px;
    }

    .search-row {
        gap: 7px;
    }

    .search-row .button {
        min-width: 63px;
        padding: 0 10px;
    }
}
