:root {
    --bg: #050506;
    --bg-soft: #09090b;
    --card: #111114;
    --card-2: #0b0b0d;
    --border: rgba(255, 255, 255, .08);
    --border-soft: rgba(255, 255, 255, .06);
    --text: #ffffff;
    --muted: #9a9a9f;
    --muted-2: #77777d;
    --red: #e50914;
    --red-2: #ff4b55;
    --green: #16a34a;
    --blue: #3b82f6;
    --yellow: #f59e0b;
    --gray: #555;
    --radius: 22px;
    --radius-sm: 14px;
    --shadow: 0 28px 80px rgba(0, 0, 0, .45);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, .16), transparent 32%),
        radial-gradient(circle at bottom right, rgba(229, 9, 20, .08), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

button,
.btn,
.btn-outline,
.mini-action,
.dark-button,
.btn-outline-small {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.sidebar {
    min-width: 0;
    min-height: 100vh;
    padding: 26px 20px;
    background:
        linear-gradient(180deg, rgba(229, 9, 20, .10), transparent 28%),
        rgba(7, 7, 8, .92);
    border-right: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    min-width: 0;
}

.logo > span {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--red), #73050b);
    color: #fff;
    font-weight: 950;
    letter-spacing: -.04em;
    box-shadow: 0 12px 26px rgba(229, 9, 20, .25);
}

.logo strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    word-break: break-word;
}

.logo small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.sidebar nav {
    display: grid;
    gap: 9px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    padding: 13px 14px;
    border-radius: 15px;
    color: #b8b8bd;
    background: transparent;
    border: 1px solid transparent;
    font-weight: 800;
    line-height: 1.2;
    transition: .18s ease;
}

.sidebar nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .045);
    border-color: var(--border-soft);
}

.sidebar nav a.active {
    color: #fff;
    background: rgba(229, 9, 20, .17);
    border-color: rgba(229, 9, 20, .35);
    box-shadow: inset 0 0 0 1px rgba(229, 9, 20, .08);
}

.main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -.055em;
    word-break: break-word;
}

.topbar p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    word-break: break-word;
}

.btn-outline,
.btn-outline-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 11px 15px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .025);
    color: #fff;
    font-weight: 850;
    transition: .18s ease;
}

.btn-outline:hover,
.btn-outline-small:hover {
    border-color: rgba(229, 9, 20, .4);
    background: rgba(229, 9, 20, .10);
}

.stats {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, .12), transparent 42%),
        var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, .22);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
    word-break: break-word;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-size: clamp(28px, 4vw, 42px);
    line-height: .95;
    letter-spacing: -.06em;
    word-break: break-word;
}

.panel-card {
    width: 100%;
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius);
    background: rgba(17, 17, 20, .92);
    border: 1px solid var(--border);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .24);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    min-width: 0;
}

.card-head h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.035em;
    word-break: break-word;
}

.card-head a {
    color: #ff8d95;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.card-head a:hover {
    color: #fff;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.alert {
    width: 100%;
    min-width: 0;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(229, 9, 20, .14);
    border: 1px solid rgba(229, 9, 20, .30);
    color: #ffb8bd;
    line-height: 1.55;
    word-break: break-word;
}

.alert.success {
    background: rgba(22, 163, 74, .13);
    border-color: rgba(22, 163, 74, .30);
    color: #9dffbd;
}

form {
    width: 100%;
    min-width: 0;
}

label {
    display: block;
    margin: 12px 0 7px;
    color: #d7d7dc;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.35;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #070708;
    color: #fff;
    outline: 0;
    padding: 13px 14px;
    font-size: 14px;
    line-height: 1.35;
    transition: .18s ease;
}

textarea {
    resize: vertical;
    min-height: 96px;
}

input::placeholder,
textarea::placeholder {
    color: #66666d;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(229, 9, 20, .55);
    box-shadow: 0 0 0 4px rgba(229, 9, 20, .10);
}

input[type="file"] {
    padding: 12px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(229, 9, 20, .18);
    color: #fff;
    padding: 9px 11px;
    font-weight: 850;
    cursor: pointer;
}

button,
button[type="submit"] {
    width: 100%;
    margin-top: 14px;
    min-height: 44px;
    padding: 12px 15px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--red), #9f0710);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 14px 34px rgba(229, 9, 20, .18);
    transition: .18s ease;
}

button:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(229, 9, 20, .25);
}

.dark-button {
    background: #222226 !important;
    border: 1px solid rgba(255, 255, 255, .09) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.dark-button:hover {
    background: #2c2c31 !important;
}

.mini-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(229, 9, 20, .15);
    border: 1px solid rgba(229, 9, 20, .30);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    transition: .18s ease;
}

.mini-action:hover {
    background: var(--red);
    border-color: var(--red);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    white-space: nowrap;
}

.pill.green {
    background: rgba(22, 163, 74, .16);
    color: #9dffbd;
}

.pill.red {
    background: rgba(229, 9, 20, .17);
    color: #ff9aa0;
}

.pill.gray {
    background: rgba(255, 255, 255, .08);
    color: #c8c8cd;
}

.pill.blue {
    background: rgba(59, 130, 246, .15);
    color: #8dbbff;
}

.pill.yellow {
    background: rgba(245, 158, 11, .15);
    color: #ffd36b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: middle;
    color: #d7d7dc;
    font-size: 14px;
}

th {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

td {
    word-break: break-word;
}

tr:hover td {
    background: rgba(255, 255, 255, .025);
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
}

.empty-state {
    width: 100%;
    min-width: 0;
    padding: 22px;
    border-radius: 18px;
    background: var(--card-2);
    border: 1px dashed rgba(255, 255, 255, .16);
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.3;
    word-break: break-word;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

/* LOGIN SAYFALARI */

.admin-login-body,
.login-body,
.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, .20), transparent 34%),
        radial-gradient(circle at bottom right, rgba(229, 9, 20, .10), transparent 34%),
        var(--bg);
}

.admin-login-card,
.login-card,
.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, .14), transparent 40%),
        var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.admin-login-card h1,
.login-card h1,
.auth-card h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: -.055em;
}

.admin-login-card p,
.login-card p,
.auth-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.55;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.auth-logo span {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--red), #73050b);
    font-weight: 950;
}

/* USER TARAFI İÇİN GENEL KART DESTEKLERİ */

.user-card,
.dashboard-card,
.program-card,
.appointment-card {
    width: 100%;
    min-width: 0;
    padding: 18px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

/* MOBİL GENEL DÜZEN */

@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .layout {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 18px 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }

    .sidebar .logo {
        margin-bottom: 18px;
    }

    .sidebar nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        overflow: visible;
    }

    .sidebar nav a {
        width: 100%;
        min-width: 0;
        margin: 0;
        padding: 12px 8px;
        border-radius: 14px;
        text-align: center;
        justify-content: center;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar nav a[href="cikis.php"] {
        grid-column: 1 / -1;
    }

    .main {
        width: 100%;
        max-width: 100%;
        padding: 18px 16px;
        overflow-x: hidden;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .topbar h1 {
        font-size: 30px;
        line-height: 1.15;
    }

    .topbar p {
        font-size: 14px;
    }

    .topbar .btn-outline {
        width: 100%;
        text-align: center;
    }

    .panel-card {
        padding: 18px;
        border-radius: 20px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card strong {
        font-size: 30px;
    }

    .stat-card span {
        font-size: 12px;
    }
}

@media (max-width: 650px) {
    body {
        font-size: 14px;
    }

    .main {
        padding: 16px 12px;
    }

    .panel-card {
        padding: 16px;
        border-radius: 18px;
    }

    .card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .card-head h2 {
        font-size: 20px;
    }

    .card-head a {
        white-space: normal;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        border-radius: 17px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    input,
    select,
    textarea {
        padding: 12px;
        border-radius: 13px;
    }

    button,
    button[type="submit"] {
        min-height: 43px;
        border-radius: 13px;
    }

    .admin-login-card,
    .login-card,
    .auth-card {
        padding: 22px;
        border-radius: 24px;
    }
}

@media (max-width: 430px) {
    .sidebar {
        padding: 16px 12px;
    }

    .sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar nav a[href="cikis.php"] {
        grid-column: auto;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .topbar h1 {
        font-size: 28px;
    }

    .logo strong {
        font-size: 15px;
    }

    .logo small {
        font-size: 11px;
    }

    .pill {
        white-space: normal;
        text-align: center;
    }
}

.modal-open {
    overflow: hidden;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, .86);
    backdrop-filter: blur(8px);
    z-index: 10000;
}

.image-preview-modal.show {
    display: grid;
}

.image-preview-modal img {
    width: auto;
    max-width: 96vw;
    max-height: 86vh;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 30px 90px rgba(0,0,0,.6);
    object-fit: contain;
}

.image-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    background: #e50914;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    z-index: 10001;
}