/* ============================================================
   main.css — Global Stil Sistemi
   sabitdisk.online / Tomris Bilişim Müşavir Portalı
   ============================================================ */

/* ── Tasarım Değişkenleri ─────────────────────────────────── */
:root {
    /* Renkler */
    --primary:        #2563eb;
    --primary-hover:  #1d4ed8;
    --primary-light:  #dbeafe;
    --accent:         #0ea5e9;

    --success:        #10b981;
    --success-bg:     #dcfce7;
    --warning:        #f59e0b;
    --warning-bg:     #fef3c7;
    --danger:         #ef4444;
    --danger-bg:      #fee2e2;

    /* Nötr */
    --bg-body:        #f1f5f9;
    --bg-surface:     #ffffff;
    --bg-sidebar:     #0f172a;

    --text-900:       #0f172a;
    --text-700:       #334155;
    --text-500:       #64748b;
    --text-300:       #cbd5e1;

    --border:         #e2e8f0;
    --border-focus:   var(--primary);

    /* Sidebar */
    --sidebar-w:      250px;
    --topbar-h:       64px;

    /* Geçişler */
    --transition:     all 0.2s ease;

    /* Gölgeler */
    --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
    --shadow-sm:  0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-700);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────────── */
.app {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.logo { display: flex; align-items: center; text-decoration: none; width: 100%; }
.logo img { max-width: 100%; height: auto; max-height: 50px; }

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

.sidebar-nav ul { list-style: none; }

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-nav li a i { width: 18px; text-align: center; font-size: 1rem; }

.sidebar-nav li a:hover,
.sidebar-nav li.active a {
    color: #fff;
    background: rgba(255,255,255,.06);
    border-left-color: var(--primary);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-weight: 600;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; color: #fff; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 0.75rem; color: #64748b; }

.logout-btn { color: #64748b; transition: var(--transition); }
.logout-btn:hover { color: var(--danger); text-decoration: none; }

/* ── Main content ─────────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; }

.page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-900); }

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-500);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
}

.sidebar-toggle:hover { background: var(--bg-body); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); text-decoration: none; color: #fff; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-surface);
    color: var(--text-700);
    border: 1px solid var(--border);
    padding: 0.55rem 1.25rem;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary:hover { background: var(--bg-body); text-decoration: none; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
}

.btn-danger:hover { background: #dc2626; }

.btn-icon {
    position: relative;
    background: none;
    border: none;
    color: var(--text-500);
    font-size: 1.15rem;
    width: 36px; height: 36px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover { background: var(--bg-body); color: var(--text-900); }

.notif-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

/* ── Content wrapper ──────────────────────────────────────── */
.content { padding: 2rem; flex: 1; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-xs);
}

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

.card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text-900); }
.card-body { padding: 1.5rem; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.35rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.icon-blue   { background: #dbeafe; color: #2563eb; }
.icon-red    { background: #fee2e2; color: #dc2626; }
.icon-orange { background: #fef3c7; color: #d97706; }
.icon-green  { background: #dcfce7; color: #16a34a; }
.icon-purple { background: #ede9fe; color: #7c3aed; }

.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-900); line-height: 1; }
.stat-label { font-size: 0.82rem; color: var(--text-500); margin-top: 0.25rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

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

.data-table th {
    background: #f8fafc;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-500);
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

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

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

/* ── Status Badges ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger  { background: var(--danger-bg);  color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-gray    { background: #f1f5f9; color: var(--text-500); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-700);
    margin-bottom: 0.4rem;
}

.required { color: var(--danger); }

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-900);
    background: var(--bg-surface);
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

.input-group { position: relative; }
.input-group i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.input-group .form-control { padding-left: 2.4rem; }

/* ── Toast notification ───────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1e293b;
    color: #fff;
    padding: 0.9rem 1.4rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(.175,.885,.32,1.275);
    z-index: 9999;
    max-width: 380px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast i { font-size: 1.1rem; flex-shrink: 0; }
.toast.toast-success i { color: #34d399; }
.toast.toast-error   { background: #7f1d1d; }
.toast.toast-error i { color: #fca5a5; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main { margin-left: 0; }

    .sidebar-toggle { display: flex; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 150;
    }

    .sidebar-overlay.show { display: block; }
}
