/* ============================================
   Cami Eğitim — App stylesheet
   Palette: yeşil + altın (klasik İslami)
   Layout: sidebar dashboard, responsive
   ============================================ */

:root {
    --c-primary:        #14532d;
    --c-primary-dark:   #0d3a1f;
    --c-primary-light:  #1e6e3f;
    --c-accent:         #c9a961;
    --c-accent-dark:    #a8893f;
    --c-bg:             #fefdf8;
    --c-surface:        #ffffff;
    --c-surface-alt:    #f5f1e8;
    --c-text:           #1c2818;
    --c-text-muted:     #6b7563;
    --c-border:         #e5e0d2;
    --c-border-strong:  #cbc4b0;

    --c-success:        #2e7d32;
    --c-success-bg:     #e8f5e9;
    --c-warning:        #c77f00;
    --c-warning-bg:     #fff4d6;
    --c-danger:         #a02020;
    --c-danger-bg:      #fdecec;
    --c-info:           #0c63a3;
    --c-info-bg:        #e3f0fa;

    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 14px;
    --radius-xl: 22px;

    --shadow-sm: 0 1px 2px rgba(28,40,24,.06);
    --shadow:    0 2px 8px rgba(28,40,24,.08);
    --shadow-lg: 0 8px 28px rgba(28,40,24,.12);

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
    --font-serif: "Source Serif Pro", Georgia, serif;

    --sidebar-w: 240px;
    --topbar-h: 60px;
    --content-max: 1200px;
}

/* ============================================
   Reset & base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-accent-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .75em; font-weight: 600; line-height: 1.25; color: var(--c-text); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .8em; }

/* ============================================
   App shell — sidebar layout
   ============================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "sidebar topbar" "sidebar main";
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    color: #e8e1c8;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand .logo {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-brand .title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    line-height: 1.15;
}
.sidebar-brand .subtitle {
    font-size: .72rem;
    color: rgba(232,225,200,.7);
    margin-top: 2px;
}

.sidebar-section-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(232,225,200,.55);
    padding: 1.1rem 1.25rem .35rem;
    font-weight: 600;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: .35rem 0;
    flex: 1;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 1.25rem;
    color: rgba(232,225,200,.85);
    border-left: 3px solid transparent;
    font-size: .92rem;
    transition: all .12s;
    text-decoration: none;
}
.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
    border-left-color: var(--c-accent);
    text-decoration: none;
}
.sidebar-nav a.active {
    color: #fff;
    background: rgba(201,169,97,.13);
    border-left-color: var(--c-accent);
    font-weight: 600;
}
.sidebar-nav a .icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}
.sidebar-nav a .badge {
    margin-left: auto;
    background: var(--c-accent);
    color: var(--c-primary-dark);
    font-size: .7rem;
    font-weight: 700;
    padding: .1rem .42rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .75rem 1.25rem;
    font-size: .78rem;
    color: rgba(232,225,200,.6);
}

/* Topbar */
.topbar {
    grid-area: topbar;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.05rem; font-weight: 600; color: var(--c-text); }
.topbar-actions { display: flex; align-items: center; gap: .9rem; }

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--c-text);
    font-size: 1.4rem;
    padding: .25rem .5rem;
}

.lang-switch { display: flex; gap: .15rem; align-items: center; font-size: .82rem; }
.lang-switch a {
    color: var(--c-text-muted);
    padding: .2rem .5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 500;
}
.lang-switch a:hover { background: var(--c-surface-alt); color: var(--c-text); text-decoration: none; }
.lang-switch a.active { background: var(--c-primary); color: #fff; font-weight: 600; }

.user-menu { display: flex; align-items: center; gap: .55rem; font-size: .85rem; }
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-primary);
    color: var(--c-accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}
.user-info { line-height: 1.2; }
.user-info .name { font-weight: 600; color: var(--c-text); }
.user-info .role { color: var(--c-text-muted); font-size: .76rem; }
.logout-btn {
    background: none;
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    padding: .35rem .7rem;
    border-radius: var(--radius);
    font-size: .82rem;
    transition: all .12s;
}
.logout-btn:hover { color: var(--c-danger); border-color: var(--c-danger); background: var(--c-danger-bg); }

/* Main content */
.main {
    grid-area: main;
    padding: 1.5rem 2rem 3rem;
    overflow-x: hidden;
}
.main > .container { max-width: var(--content-max); margin: 0 auto; }

/* Auth pages (no sidebar) */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 20% 10%, rgba(20,83,45,.06), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(201,169,97,.08), transparent 40%),
        var(--c-bg);
}
.auth-lang {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    gap: .15rem;
    align-items: center;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: .25rem .35rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    font-size: .78rem;
}
.auth-lang a {
    color: var(--c-text-muted);
    padding: .2rem .55rem;
    border-radius: 999px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: .03em;
}
.auth-lang a:hover { color: var(--c-text); text-decoration: none; background: var(--c-surface-alt); }
.auth-lang a.active { background: var(--c-primary); color: #fff; }

.auth-card {
    width: 100%;
    max-width: 360px;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.2rem;
    border-top: 4px solid var(--c-primary);
}
.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-brand .logo {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
    color: var(--c-accent);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.6rem;
    margin-bottom: .6rem;
    box-shadow: var(--shadow);
}
.auth-brand .title { margin: 0; font-size: 1.25rem; }
.auth-brand .subtitle { color: var(--c-text-muted); font-size: .82rem; margin-top: .25rem; }

/* ============================================
   Components
   ============================================ */

/* Cards */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--c-border);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body > *:last-child { margin-bottom: 0; }

/* Stat tile (dashboard) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--c-primary);
}
.stat.accent::before { background: var(--c-accent); }
.stat.warning::before { background: var(--c-warning); }
.stat.danger::before { background: var(--c-danger); }
.stat .label { font-size: .78rem; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; }
.stat .value { font-size: 1.85rem; font-weight: 700; color: var(--c-text); line-height: 1; }
.stat .hint { font-size: .78rem; color: var(--c-text-muted); margin-top: .35rem; }

/* Buttons */
.btn, button.btn, a.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; border-color: var(--c-primary-dark); }
.btn-accent {
    background: var(--c-accent);
    color: var(--c-primary-dark);
    border-color: var(--c-accent);
}
.btn-accent:hover { background: var(--c-accent-dark); color: #fff; border-color: var(--c-accent-dark); }
.btn-outline {
    background: transparent;
    color: var(--c-primary);
    border-color: var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-surface-alt); }
.btn-danger {
    background: var(--c-surface);
    color: var(--c-danger);
    border-color: var(--c-danger);
}
.btn-danger:hover { background: var(--c-danger); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: .35rem;
}
.form-label .required { color: var(--c-danger); }
.form-label .hint { color: var(--c-text-muted); font-weight: 400; font-size: .78rem; }

.form-control,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="tel"], input[type="search"],
input[type="url"], select, textarea {
    width: 100%;
    padding: .55rem .75rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    font-size: .92rem;
    color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(20,83,45,.12);
}
textarea { min-height: 90px; resize: vertical; font-family: inherit; }
input[type="checkbox"], input[type="radio"] {
    width: auto; vertical-align: middle; margin-right: .35rem;
    accent-color: var(--c-primary);
}
.form-help { display: block; font-size: .78rem; color: var(--c-text-muted); margin-top: .25rem; }
.form-error { display: block; font-size: .8rem; color: var(--c-danger); margin-top: .25rem; }

.form-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--c-border);
    flex-wrap: wrap;
}

/* Alerts */
.alert {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 1rem;
    font-size: .9rem;
    display: flex;
    gap: .55rem;
    align-items: flex-start;
}
.alert::before { font-size: 1.05rem; line-height: 1.3; flex-shrink: 0; }
.alert-success { background: var(--c-success-bg); border-color: #b6d8b9; color: #1c4a1f; }
.alert-success::before { content: "✓"; color: var(--c-success); }
.alert-warning { background: var(--c-warning-bg); border-color: #e5cb78; color: #6e4500; }
.alert-warning::before { content: "⚠"; color: var(--c-warning); }
.alert-danger { background: var(--c-danger-bg); border-color: #e8a5a5; color: #6d1414; }
.alert-danger::before { content: "✗"; color: var(--c-danger); }
.alert-info { background: var(--c-info-bg); border-color: #a3cce6; color: #0a3e63; }
.alert-info::before { content: "ℹ"; color: var(--c-info); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table thead { background: var(--c-surface-alt); }
.table thead th {
    text-align: left;
    padding: .65rem .85rem;
    font-weight: 600;
    color: var(--c-text-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--c-border);
}
.table tbody td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--c-surface-alt); }
.table .actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .55rem;
    border-radius: 12px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.badge-primary { background: var(--c-primary); color: #fff; }
.badge-accent { background: var(--c-accent); color: var(--c-primary-dark); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-muted { background: var(--c-surface-alt); color: var(--c-text-muted); }

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--c-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    gap: 0;
}
.tabs a {
    padding: .65rem 1.1rem;
    color: var(--c-text-muted);
    font-size: .92rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .12s;
}
.tabs a:hover { color: var(--c-text); text-decoration: none; }
.tabs a.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--c-border);
}
.page-header h1 { margin: 0 0 .15rem; }
.page-header .subtitle { color: var(--c-text-muted); font-size: .88rem; }
.page-header .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Empty state */
.empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--c-text-muted);
}
.empty .icon { font-size: 2.2rem; opacity: .4; margin-bottom: .5rem; }

/* Section heads inside cards */
.section-head {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--c-text-muted);
    margin: 1rem 0 .5rem;
    font-weight: 600;
}

/* Misc */
.text-muted { color: var(--c-text-muted); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-danger { color: var(--c-danger); }
.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.flex { display: flex; }
.flex-gap { display: flex; gap: .5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.hidden { display: none !important; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

hr.divider { border: 0; height: 1px; background: var(--c-border); margin: 1.5rem 0; }

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(28, 40, 24, 0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--c-surface);
    width: 100%;
    max-width: 760px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--c-primary);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; }
.modal-close {
    background: none;
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.modal-close:hover { color: var(--c-danger); border-color: var(--c-danger); background: var(--c-danger-bg); }
.modal-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}
.modal-body h2 { font-size: 1.2rem; margin-bottom: .8rem; }
.modal-body h3 { font-size: 1rem; margin-top: 1.2rem; }
.modal-body hr { border: 0; border-top: 1px solid var(--c-border); margin: 1rem 0; }
.modal-body ul { padding-left: 1.4rem; margin: .5rem 0 1rem; }
.modal-body li { margin: .25rem 0; }
.modal-body p { margin: .5rem 0; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .85rem 1.5rem;
    border-top: 1px solid var(--c-border);
    flex-shrink: 0;
}
.modal-loading { text-align: center; padding: 2rem; color: var(--c-text-muted); }

a.contract-link {
    color: var(--c-primary);
    text-decoration: underline;
    font-weight: 600;
}

/* ============================================
   Tag select (autocomplete multi-select)
   ============================================ */
.tag-select {
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    background: var(--c-surface);
    padding: .35rem .4rem;
    min-height: 2.4rem;
    transition: border-color .15s, box-shadow .15s;
}
.tag-select.focused {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(20,83,45,.12);
}
.tag-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .35rem;
}
.tag-select-tags:empty { display: none; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--c-primary);
    color: #fff;
    padding: .2rem .55rem .2rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    line-height: 1.3;
}
.tag-chip button {
    background: none;
    border: 0;
    color: var(--c-accent);
    cursor: pointer;
    padding: 0 0 0 .2rem;
    font-size: 1rem;
    line-height: 1;
    border-left: 1px solid rgba(255,255,255,.3);
    margin-left: .15rem;
}
.tag-chip button:hover { color: #fff; }
.tag-select-search {
    position: relative;
}
.tag-select-search input {
    width: 100%;
    border: 0;
    padding: .35rem .25rem;
    background: transparent;
    font-size: .9rem;
    color: var(--c-text);
}
.tag-select-search input:focus { outline: none; box-shadow: none; }
.tag-select-dropdown {
    position: absolute;
    top: calc(100% + .25rem);
    left: 0;
    right: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}
.tag-select-dropdown.open { display: block; }
.tag-select-option {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .9rem;
    color: var(--c-text);
    transition: background .1s;
}
.tag-select-option:hover, .tag-select-option.highlighted {
    background: var(--c-surface-alt);
}
.tag-select-option.no-match {
    color: var(--c-text-muted);
    font-style: italic;
    cursor: default;
}
.tag-select-option.no-match:hover { background: transparent; }

/* ============================================
   Book progress widget
   ============================================ */
.book-progress {
    background: var(--c-surface-alt);
    border-radius: var(--radius);
    padding: .7rem .9rem;
    margin: .25rem 0 .5rem;
    border-left: 3px solid var(--c-accent);
}
.book-progress-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: .5rem; margin-bottom: .45rem; font-size: .9rem;
    flex-wrap: wrap;
}
.book-progress-bar {
    height: 8px;
    background: var(--c-surface);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.book-progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--c-accent) 0%, var(--c-primary) 100%);
    transition: width .3s ease;
}

/* ============================================
   Attendance — mobile-first card list
   ============================================ */
.att-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .65rem;
    align-items: start;
}
.att-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-border-strong);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    transition: border-left-color .15s;
}
.att-card[data-status="present"] { border-left-color: var(--c-success); }
.att-card[data-status="late"]    { border-left-color: var(--c-warning); }
.att-card[data-status="absent"]  { border-left-color: var(--c-danger); }
.att-card[data-status="excused"] { border-left-color: var(--c-info); }

.att-head {
    display: flex; justify-content: flex-start; align-items: center;
    gap: .65rem; margin-bottom: .55rem;
}
.att-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--c-surface-alt);
    color: var(--c-text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--c-border);
}
.att-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-avatar.gender-m { background: #e1ecf6; color: #1e5e8b; }
.att-avatar.gender-f { background: #f6e1ec; color: #8b1e5e; }
.att-name { font-weight: 600; font-size: 1rem; line-height: 1.2; }
.att-meta { color: var(--c-text-muted); font-size: .78rem; }

.att-status {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
    margin-bottom: .35rem;
}
.att-status label {
    cursor: pointer;
    user-select: none;
}
.att-status label input { position: absolute; opacity: 0; pointer-events: none; }
.att-status .pill {
    display: flex; align-items: center; justify-content: center;
    padding: .55rem .3rem;
    border-radius: var(--radius);
    border: 1px solid var(--c-border-strong);
    background: var(--c-surface);
    color: var(--c-text-muted);
    font-size: .82rem;
    font-weight: 500;
    text-align: center;
    transition: all .12s;
}
.att-status label:hover .pill { border-color: var(--c-primary); color: var(--c-text); }
.att-status input:checked + .pill {
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.att-status label[data-st="present"] input:checked + .pill { background: var(--c-success); border-color: var(--c-success); }
.att-status label[data-st="late"]    input:checked + .pill { background: var(--c-warning); border-color: var(--c-warning); color: #2a1f00; }
.att-status label[data-st="absent"]  input:checked + .pill { background: var(--c-danger); border-color: var(--c-danger); }
.att-status label[data-st="excused"] input:checked + .pill { background: var(--c-info); border-color: var(--c-info); }

.att-late {
    display: none;
    align-items: center;
    gap: .5rem;
    margin: .55rem 0 .25rem;
    font-size: .85rem;
}
.att-card[data-status="late"] .att-late { display: flex; }
.att-late input[type="number"] { width: 5rem; text-align: center; }

.att-hw {
    background: var(--c-surface-alt);
    border-radius: var(--radius);
    padding: .55rem .7rem;
    margin: .5rem 0 .25rem;
    border-left: 3px solid var(--c-accent);
    font-size: .85rem;
}
.att-hw-book { font-size: .85rem; margin-bottom: .25rem; }
.att-hw-info {
    display: flex; justify-content: space-between; align-items: center;
    gap: .4rem; flex-wrap: wrap; margin-bottom: .35rem;
}
.att-hw-actions {
    display: flex; gap: .3rem; flex-wrap: wrap;
}

.att-toggle {
    background: none; border: 0; padding: .35rem 0;
    color: var(--c-primary); font-size: .82rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: .25rem;
}
.att-toggle::before { content: "▸"; transition: transform .15s; display: inline-block; }
.att-card.expanded .att-toggle::before { transform: rotate(90deg); }
.att-details { display: none; padding-top: .5rem; }
.att-card.expanded .att-details { display: block; }

.att-details label { display: block; font-size: .82rem; margin-bottom: .4rem; }
.att-details label > span { display: block; color: var(--c-text-muted); margin-bottom: .15rem; }
.att-pickup-warn { color: var(--c-danger); font-size: .72rem; margin-top: .15rem; }

.att-save-bar {
    position: sticky;
    bottom: 0;
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: .75rem 0;
    margin-top: 1rem;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem;
    z-index: 30;
    box-shadow: 0 -4px 12px rgba(28,40,24,.06);
}
.att-save-bar .summary { font-size: .85rem; color: var(--c-text-muted); }

@media (max-width: 540px) {
    .att-status { grid-template-columns: repeat(2, 1fr); }
    .att-status .pill { padding: .65rem .3rem; }
    .att-card { padding: .85rem .85rem; }
}

/* ============================================
   Responsive — Mobile (sidebar drawer)
   ============================================ */
@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--topbar-h) 1fr;
        grid-template-areas: "topbar" "main";
    }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh;
        width: var(--sidebar-w);
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s, visibility .2s;
        z-index: 45;
    }
    .sidebar-backdrop.open { opacity: 1; visibility: visible; }
    .hamburger { display: inline-flex; }
    .main { padding: 1rem; }
    .topbar { padding: 0 .85rem; }
    .user-info { display: none; }
    .topbar-title { font-size: .95rem; }
}

@media (max-width: 540px) {
    .topbar-actions { gap: .5rem; }
    .lang-switch a { padding: .15rem .35rem; font-size: .75rem; }
    .logout-btn { padding: .3rem .5rem; }
    .logout-btn .label { display: none; }
    .stat .value { font-size: 1.5rem; }
    .page-header { align-items: flex-start; }
    .auth-card { padding: 1.5rem 1.25rem; }
}

/* ============================================
   Üyelik / aidat (Mitglieder & Beiträge)
   ============================================ */
.badge-info { background: var(--c-info-bg); color: var(--c-info); }

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--c-border);
}

.table-plain td {
    padding: .4rem .5rem;
    border: none;
    vertical-align: top;
    font-size: .88rem;
}
.table-plain td:first-child { width: 38%; white-space: nowrap; }

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-right: 1rem;
    font-size: .9rem;
    cursor: pointer;
}
.checkbox-inline input { width: auto; margin: 0; }

/* Üye detayındaki 12 aylık şerit (salt görüntü) */
.fee-months { display: flex; flex-wrap: wrap; gap: .3rem; }
.fee-month {
    flex: 1 0 auto;
    min-width: 44px;
    text-align: center;
    padding: .35rem .2rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: .72rem;
    font-weight: 600;
    color: var(--c-text-muted);
    background: var(--c-surface-alt);
}
.fee-month.paid {
    background: var(--c-success-bg);
    border-color: var(--c-success);
    color: var(--c-success);
}

/* Aidat çeltik tablosu (kâğıt listenin dijital karşılığı) */
.fee-grid { border-collapse: separate; border-spacing: 0; width: 100%; }
.fee-grid th, .fee-grid td { border-bottom: 1px solid var(--c-border); }
.fee-grid thead th {
    position: sticky;
    top: 0;
    background: var(--c-surface-alt);
    z-index: 2;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: .5rem .3rem;
    text-align: center;
}
.fee-grid thead th.name-col, .fee-grid tbody td.name-col {
    position: sticky;
    left: 0;
    background: var(--c-surface);
    z-index: 3;
    text-align: left;
    min-width: 170px;
    box-shadow: 1px 0 0 var(--c-border);
}
.fee-grid thead th.name-col { background: var(--c-surface-alt); z-index: 4; }
.fee-grid tbody td { padding: .25rem .3rem; text-align: center; }

.fee-cell {
    display: block;
    width: 100%;
    min-width: 34px;
    padding: .45rem .1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text-muted);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s, border-color .12s, transform .06s;
}
.fee-cell:hover { border-color: var(--c-primary-light); transform: translateY(-1px); }
.fee-cell.paid {
    background: var(--c-success-bg);
    border-color: var(--c-success);
    color: var(--c-success);
}
.fee-cell.future { opacity: .45; }
.fee-cell.busy { opacity: .5; cursor: wait; }
.fee-cell:disabled { cursor: not-allowed; opacity: .4; }

.fee-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--c-text-muted);
    margin-top: .75rem;
}
.fee-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.fee-legend i {
    width: 14px; height: 14px; border-radius: 3px; display: inline-block;
    border: 1px solid var(--c-border); background: var(--c-surface);
}
.fee-legend i.paid { background: var(--c-success-bg); border-color: var(--c-success); }

.fee-total { font-weight: 700; white-space: nowrap; }
.fee-debt { color: var(--c-danger); font-weight: 700; white-space: nowrap; }

/* Modal (peşin ödeme diyaloğu) */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(28,40,24,.5);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}
.modal-box h2 { margin: 0 0 1rem 0; font-size: 1.1rem; }

/* ============================================
   Print
   ============================================ */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .app-shell { display: block; }
    .main { padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
