/* ============================================================
   Amazon Paket - Modern UI Framework
   ============================================================ */

:root {
    --primary: #ff9900;
    --primary-dark: #e88800;
    --primary-light: #ffb34d;
    --secondary: #232f3e;
    --secondary-light: #37475a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.10);
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-w: 260px;
    --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
                 "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== LAYOUT ============== */
.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas: "sidebar header" "sidebar main";
}
.sidebar {
    grid-area: sidebar;
    background: var(--secondary);
    color: #cbd5e1;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}
.header {
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.main {
    grid-area: main;
    padding: 1.5rem;
}
@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        z-index: 100;
        transition: left .25s ease;
        height: 100vh;
    }
    .sidebar.open { left: 0; }
    .sidebar-overlay { display: none; }
    .sidebar.open + .sidebar-overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(0,0,0,.4); z-index: 99;
    }
}

/* ============== SIDEBAR ============== */
.brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--secondary-light);
}
.brand-logo {
    width: 40px; height: 40px;
    background: var(--primary);
    color: #000;
    border-radius: 8px;
    display: grid; place-items: center;
    font-weight: 700; font-size: 1.1rem;
}
.brand-name { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.brand-sub { font-size: .75rem; color: #94a3b8; }

.nav { padding: 1rem 0; }
.nav-section {
    padding: .5rem 1.5rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin-top: .5rem;
}
.nav a {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.5rem;
    color: #cbd5e1;
    font-size: .9rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.nav a:hover { background: var(--secondary-light); color: #fff; text-decoration: none; }
.nav a.active {
    background: rgba(255,153,0,.1);
    color: var(--primary);
    border-left-color: var(--primary);
}
.nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav .badge { margin-left: auto; }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }

/* ============== HEADER ============== */
.header-left { display: flex; align-items: center; gap: 1rem; }
.menu-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: .5rem; border-radius: 6px;
}
.menu-toggle:hover { background: var(--bg); }
@media (max-width: 900px) { .menu-toggle { display: block; } }
.search-box {
    display: flex; align-items: center; gap: .5rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .5rem .75rem;
    width: 320px; max-width: 100%;
}
.search-box input { border: 0; background: transparent; outline: none; flex: 1; font-size: .9rem; }
@media (max-width: 600px) { .search-box { display: none; } }
.header-right { display: flex; align-items: center; gap: 1rem; }

.icon-btn {
    position: relative;
    background: none; border: none; cursor: pointer;
    padding: .5rem; border-radius: 8px;
    display: grid; place-items: center;
    color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn .dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
}

.user-menu { position: relative; }
.user-trigger {
    display: flex; align-items: center; gap: .5rem;
    padding: .25rem .5rem; border-radius: 8px; cursor: pointer;
    background: none; border: none;
}
.user-trigger:hover { background: var(--bg); }
.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #000; font-weight: 700;
    display: grid; place-items: center;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { text-align: left; line-height: 1.2; }
.user-name { font-weight: 600; font-size: .9rem; }
.user-role { font-size: .75rem; color: var(--text-muted); }
@media (max-width: 600px) { .user-info { display: none; } }

.dropdown {
    position: absolute; top: 100%; right: 0; margin-top: .5rem;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    min-width: 200px; z-index: 50;
    display: none;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: .5rem;
    padding: .65rem 1rem; color: var(--text);
    width: 100%; text-align: left;
    background: none; border: none; cursor: pointer; font-size: .9rem;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg); text-decoration: none; }
.dropdown hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; }

/* ============== CARDS ============== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: #fafbfc; }

/* ============== STAT CARDS ============== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: grid; place-items: center;
    background: rgba(59,130,246,.1); color: var(--info);
    flex-shrink: 0;
}
.stat-icon.success { background: rgba(16,185,129,.1); color: var(--success); }
.stat-icon.warning { background: rgba(245,158,11,.1); color: var(--warning); }
.stat-icon.danger  { background: rgba(239,68,68,.1);  color: var(--danger); }
.stat-icon.primary { background: rgba(255,153,0,.1);  color: var(--primary); }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.info { background: rgba(59,130,246,.1); color: var(--info); }

/* Inline SVG icons (emoji yerine) */
.ico { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex-shrink: 0; line-height: 0; }
.ico svg { display: block; }
.ico-sm svg { width: 16px; height: 16px; }
.ico-md svg { width: 20px; height: 20px; }
.ico-lg svg { width: 28px; height: 28px; }
.ico-xl svg { width: 40px; height: 40px; }
.ico-dot svg { width: 18px; height: 18px; }
.ico-title { margin-right: .35rem; }
.page-header h1, .page-header h1 .ico-title { display: inline-flex; align-items: center; gap: .45rem; }
.card-header h3 { display: flex; align-items: center; gap: .4rem; }
.btn .ico { margin-right: .35em; }
.btn .ico:last-child { margin-right: 0; margin-left: .35em; }
.label-ico { display: inline-flex; align-items: center; gap: .35rem; }
.meta-ico { display: inline-flex; align-items: flex-start; gap: .4rem; }
.meta-ico .ico { margin-top: .1rem; }
.report-card-icon .ico svg { width: 40px; height: 40px; opacity: .85; }
.empty-icon .ico svg { width: 64px; height: 64px; opacity: .35; }
.pub-lang { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.pub-lang a { font-size: .8rem !important; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: var(--text-muted); }
.stat-change { font-size: .75rem; margin-top: .25rem; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============== BUTTONS ============== */
.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .55rem 1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--bg);
    color: var(--text);
    font-size: .9rem; font-weight: 500;
    cursor: pointer; text-decoration: none;
    transition: all .15s ease;
    line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-info    { background: var(--info);    color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-sm { padding: .35rem .65rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-icon { padding: .45rem; }

/* ============== FORMS ============== */
.form-group { margin-bottom: 1rem; }
.form-grid { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }
.required::after { content: " *"; color: var(--danger); }
.form-control, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url],
select, textarea {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-size: .9rem;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
    color: var(--text);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,153,0,.15);
}
textarea { resize: vertical; min-height: 80px; }
.form-help { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: .25rem; }
.form-control.error { border-color: var(--danger); }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input { width: auto; }

/* ============== TABLES ============== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td {
    text-align: left; padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th {
    background: #fafbfc; font-weight: 600;
    color: var(--text-muted); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .03em;
}
.table tbody tr:hover { background: #fafbfc; }
.table-actions { display: flex; gap: .25rem; justify-content: flex-end; }

/* ============== BADGES ============== */
.badge {
    display: inline-flex; align-items: center;
    padding: .25rem .55rem;
    border-radius: 6px;
    font-size: .75rem; font-weight: 600;
    background: var(--bg); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-success  { background: rgba(16,185,129,.1); color: var(--success); border-color: transparent; }
.badge-danger   { background: rgba(239,68,68,.1);  color: var(--danger);  border-color: transparent; }
.badge-warning  { background: rgba(245,158,11,.1); color: var(--warning); border-color: transparent; }
.badge-info     { background: rgba(59,130,246,.1); color: var(--info);    border-color: transparent; }
.badge-primary  { background: rgba(255,153,0,.1);  color: var(--primary-dark); border-color: transparent; }
.badge-secondary{ background: rgba(35,47,62,.1);   color: var(--secondary); border-color: transparent; }

/* ============== ALERTS ============== */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
    background: #fff;
    display: flex; gap: .5rem; align-items: flex-start;
}
.alert-success { border-color: var(--success); background: rgba(16,185,129,.05); color: #065f46; }
.alert-danger  { border-color: var(--danger);  background: rgba(239,68,68,.05);  color: #991b1b; }
.alert-warning { border-color: var(--warning); background: rgba(245,158,11,.05); color: #92400e; }
.alert-info    { border-color: var(--info);    background: rgba(59,130,246,.05); color: #1e40af; }

/* ============== UTILITIES ============== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: .8rem; }
.text-lg { font-size: 1.1rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: .25rem; font-size: .9rem; }

.empty {
    text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty svg { width: 64px; height: 64px; opacity: .3; margin-bottom: 1rem; }

.pagination { display: flex; gap: .25rem; justify-content: center; padding: 1rem; }
.pagination .page {
    padding: .35rem .65rem; border: 1px solid var(--border); border-radius: 6px;
    background: #fff; color: var(--text); font-size: .85rem;
}
.pagination .page:hover { background: var(--bg); text-decoration: none; }
.pagination .page.active { background: var(--primary); color: #000; border-color: var(--primary); }
.pagination .page.disabled { opacity: .5; pointer-events: none; }

/* ============== TIMELINE ============== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: ''; position: absolute; left: .65rem; top: .25rem; bottom: 0;
    width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -1.5rem; top: .25rem;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary); border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}
.timeline-item .time { font-size: .75rem; color: var(--text-muted); }

/* ============== MAP ============== */
.map { width: 100%; height: 480px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); }

/* ============== RESPONSIVE GRID ============== */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ============== TABS ============== */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
    padding: .65rem 1rem; border: 0; background: none; cursor: pointer;
    font-size: .9rem; color: var(--text-muted);
    border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-color: var(--primary); }

/* ============== TOAST ============== */
.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000;
    background: #fff; border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    padding: .75rem 1rem; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 280px; max-width: 400px;
    display: flex; gap: .5rem; align-items: flex-start;
    animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============== MODAL ============== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff; border-radius: var(--radius-lg);
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

/* ============== AUTH PAGES ============== */
.auth {
    min-height: 100vh;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    padding: 1rem;
}
.auth-card {
    background: #fff; border-radius: var(--radius-lg);
    padding: 2.5rem; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    width: 64px; height: 64px; border-radius: 14px;
    background: var(--primary); color: #000;
    display: grid; place-items: center; margin: 0 auto 1rem;
    font-weight: 700; font-size: 1.5rem;
}
.auth h1 { text-align: center; font-size: 1.4rem; margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }
