/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #4F46E5;
    --primary-dk: #3730A3;
    --success:    #10B981;
    --danger:     #EF4444;
    --warn:       #F59E0B;
    --bg:         #F9FAFB;
    --surface:    #FFFFFF;
    --border:     #E5E7EB;
    --text:       #111827;
    --muted:      #6B7280;
    --sidebar-bg: #1E1B4B;
    --sidebar-w:  240px;
    --radius:     10px;
    --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth ─────────────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo .logo-icon { font-size: 2.5rem; }
.auth-logo h1 { font-size: 1.4rem; color: var(--primary); margin-top: .5rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .4rem;
}

.form-group input,
.input-password {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .95rem;
    transition: border-color .15s;
}

.form-group input {
    padding: .6rem .8rem;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.input-password {
    display: flex;
    overflow: hidden;
}

.input-password input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.input-password button {
    background: none;
    border: none;
    padding: 0 .75rem;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: .75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-top: .5rem;
}

.btn-primary:hover:not(:disabled) { background: var(--primary-dk); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    font-size: .875rem;
    margin-bottom: 1rem;
}

.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }

/* ── Dashboard ────────────────────────────────────────── */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}

.sidebar.super { background: #1a1a2e; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-brand .logo-icon { font-size: 1.5rem; }
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 1rem; }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1rem;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    transition: background .15s, color .15s;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover:not(.disabled),
.nav-item.active {
    background: rgba(255,255,255,.1);
    color: #fff;
    text-decoration: none;
}

.nav-item.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.user-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-avatar.super { background: var(--warn); }

.user-email {
    color: rgba(255,255,255,.9);
    font-size: .8rem;
    word-break: break-all;
}

.user-role {
    color: rgba(255,255,255,.5);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.user-role.super { color: #FCD34D; }

.btn-logout {
    display: block;
    width: 100%;
    padding: .5rem;
    background: rgba(239,68,68,.15);
    color: #FCA5A5;
    border: 1px solid rgba(239,68,68,.3);
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s;
}

.btn-logout:hover { background: rgba(239,68,68,.3); }

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - var(--sidebar-w));
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header .subtitle { color: var(--muted); font-size: .875rem; margin-top: .2rem; }

.header-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: .35rem .75rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.info-card-icon { font-size: 2rem; flex-shrink: 0; }
.info-card-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.info-card-value { font-size: 1rem; font-weight: 600; color: var(--text); margin-top: .2rem; }
.info-card-value.stat { font-size: 1.75rem; color: var(--primary); }

.notice-box {
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    color: #3730A3;
    font-size: .9rem;
}

/* ── Milestone 2 – Yeni Stiller ──────────────────────── */

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: .9rem;
    transition: box-shadow .15s, border-color .15s;
    cursor: pointer;
}

.quick-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
    text-decoration: none;
}

.quick-icon { font-size: 1.75rem; }

/* Back link */
.back-link {
    display: inline-block;
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: .35rem;
    text-decoration: none;
}
.back-link:hover { color: var(--primary); }

/* Page header button */
.btn-primary-sm {
    padding: .5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary-sm:hover { background: var(--primary-dk); color:#fff; text-decoration:none; }
.btn-primary-sm:disabled { opacity:.6; cursor:not-allowed; }

.btn-ghost {
    padding: .5rem 1rem;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    cursor: pointer;
    transition: background .15s;
}
.btn-ghost:hover { background: var(--bg); }

.btn-danger {
    padding: .5rem 1rem;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-danger:hover { background: #DC2626; }

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem .35rem;
    border-radius: 4px;
    transition: background .1s;
    text-decoration: none;
    display: inline-block;
}
.btn-icon:hover { background: var(--bg); }
.btn-icon.danger:hover { background: #FEE2E2; }

/* Data Table */
.data-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.data-table th {
    background: var(--bg);
    padding: .75rem 1rem;
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FAFAFA; }

.td-actions { white-space: nowrap; }

/* Badges */
.badge-active   { background: #D1FAE5; color: #065F46; padding: .2rem .5rem; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-inactive { background: #F3F4F6; color: #6B7280; padding: .2rem .5rem; border-radius: 20px; font-size: .75rem; }

/* Color dot */
.color-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: .4rem;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-box.modal-lg  { max-width: 680px; }
.modal-box.modal-sm  { max-width: 380px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--muted);
    padding: .25rem;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg); }

.modal-body    { padding: 1.5rem; }
.modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; }

/* Form rows */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-row .form-group { margin-bottom: 0; }

.form-group textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .95rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

/* Toggle */
.toggle-label {
    display: flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 600;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-switch {
    width: 40px; height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 3px; left: 3px;
    transition: left .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-label input:checked + .toggle-switch { background: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { left: 21px; }

/* Checkbox grid (hizmet seçimi) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    cursor: pointer;
    padding: .25rem;
    border-radius: 4px;
}
.checkbox-item:hover { background: var(--bg); }
.checkbox-item input { cursor: pointer; }

/* Staff cell */
.staff-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.staff-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.staff-avatar-sm {
    display: inline-flex;
    width: 32px; height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    margin-right: .5rem;
    vertical-align: middle;
}

/* Working Hours */
.hours-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.hours-row {
    display: grid;
    grid-template-columns: 200px 1fr 80px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
}
.hours-row:last-child { border-bottom: none; }
.hours-row:hover { background: #FAFAFA; }

.hours-day { font-weight: 600; }
.hours-times { display: flex; align-items: center; gap: .75rem; }
.hours-status { text-align: right; }

.time-group { display: flex; flex-direction: column; gap: .25rem; }
.time-group label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.time-group input[type="time"] {
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    outline: none;
}
.time-group input[type="time"]:focus { border-color: var(--primary); }
.time-sep { color: var(--muted); font-size: 1.2rem; margin-top: 1rem; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}
.empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-state p { margin-bottom: 1rem; }

/* Loading */
.loading { text-align: center; padding: 2rem; color: var(--muted); }

/* Misc */
.text-muted { color: var(--muted); }
.text-sm    { font-size: .85rem; }
.color-input-wrap input[type="color"] {
    width: 100%; height: 42px;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 2px;
}
