/* ============================================================
   Melisa VET — Özel CSS Stilleri
   Tailwind CDN üzerine eklenen özelleştirmeler
   ============================================================ */

:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Poppins', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,.06);
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sidebar-logo .logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--green-600), var(--green-500));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
}

.sidebar-logo .logo-text h2 {
    font-size: .95rem; font-weight: 700; color: #1e293b;
}
.sidebar-logo .logo-text span {
    font-size: .72rem; color: #64748b; font-weight: 500;
    text-transform: uppercase; letter-spacing: .04em;
}

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

.nav-section-label {
    font-size: .68rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .75rem .5rem .35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: all .18s ease;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--green-50);
    color: var(--green-700);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--green-600), var(--green-500));
    color: #fff;
    box-shadow: 0 4px 14px rgba(22,163,74,.35);
}

.nav-item .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
}

.sidebar-footer {
    padding: .85rem .75rem;
    border-top: 1px solid #f1f5f9;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: .5rem;
}

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

.user-info h4 { font-size: .8rem; font-weight: 600; color: #1e293b; }
.user-info span { font-size: .7rem; color: #94a3b8; }

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

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .85rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}

.topbar-title h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
}
.topbar-title p {
    font-size: .75rem;
    color: #94a3b8;
}

.page-body {
    padding: 1.75rem;
    flex: 1;
}

/* ─── Cards ────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

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

.card-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}

.card-body { padding: 1.5rem; }

/* Stat Cards */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.4rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}

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

.stat-icon.green  { background: var(--green-100); }
.stat-icon.blue   { background: #e0f2fe; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.red    { background: #fee2e2; }

.stat-info .label { font-size: .75rem; color: #94a3b8; font-weight: 500; margin-bottom: .25rem; }
.stat-info .value { font-size: 1.65rem; font-weight: 800; color: #1e293b; line-height: 1.1; }
.stat-info .sub   { font-size: .72rem; color: #64748b; margin-top: .2rem; }

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

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

thead th {
    background: #f8fafc;
    padding: .75rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid #e2e8f0;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}

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

tbody td {
    padding: .85rem 1rem;
    color: #374151;
    vertical-align: middle;
}

/* ─── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-green  { background: var(--green-100); color: var(--green-800); }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #e0f2fe; color: #0c4a6e; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: 10px;
    font-size: .855rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .18s ease;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-600), var(--green-500));
    color: #fff;
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--green-700), var(--green-600));
    box-shadow: 0 6px 18px rgba(22,163,74,.4);
    transform: translateY(-1px);
    color: #fff;
}

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

.btn-secondary {
    background: #f1f5f9; color: #475569;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-sm { padding: .35rem .75rem; font-size: .78rem; border-radius: 8px; }
.btn-icon { padding: .45rem; border-radius: 8px; }

/* ─── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: .4rem; }
.form-label span.req { color: #ef4444; }

.form-control {
    width: 100%;
    padding: .62rem .9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: .875rem;
    color: #1e293b;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.form-control:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

select.form-control { appearance: none; cursor: pointer; }

.form-hint { font-size: .72rem; color: #94a3b8; margin-top: .3rem; }
.form-error { font-size: .72rem; color: #dc2626; margin-top: .3rem; }

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 12px;
    font-size: .855rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: .6rem;
}
.alert-success { background: var(--green-100); color: var(--green-800); border: 1px solid #bbf7d0; }
.alert-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info     { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }

/* ─── Login Page ────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    padding: 1rem;
}

.login-box {
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
    border: 1px solid #e2e8f0;
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--green-600), var(--green-500));
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin: 0 auto .9rem;
    box-shadow: 0 8px 24px rgba(22,163,74,.35);
}
.login-header h1 { font-size: 1.45rem; font-weight: 800; color: #1e293b; }
.login-header p  { font-size: .82rem; color: #94a3b8; margin-top: .3rem; }

/* ─── Sale Builder ──────────────────────────────────────── */
.sale-item-row {
    display: grid;
    grid-template-columns: 1fr 100px 120px 36px;
    gap: .5rem;
    align-items: center;
    margin-bottom: .5rem;
}

/* ─── Low stock row ─────────────────────────────────────── */
tr.low-stock td { color: #dc2626; }
tr.low-stock td:first-child::before {
    content: "⚠️ ";
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-260px); }
    .sidebar.open { transform: translateX(0); width: 260px; }
    .main-content { margin-left: 0; }
    .page-body { padding: 1rem; }
    .sale-item-row { grid-template-columns: 1fr 80px 100px 36px; }
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ─── GSAP Animation helpers ─────────────────────────────── */
.gsap-fade { opacity: 0; transform: translateY(16px); }
.gsap-scale { opacity: 0; transform: scale(.95); }
