/* SOGO FARMING SYSTEM - teal theme */
:root {
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --teal-deep: #134e4a;
    --teal-light: #ccfbf1;
    --teal-soft: #f0fdfa;
    --sidebar-w: 250px;
    --bs-primary: #0d9488;
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: #0f766e;
    --bs-link-hover-color: #134e4a;
}
body { background: #f3f6f6; font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .92rem; color: #1f2937; }
a { color: var(--teal-dark); }

.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-active-bg: var(--teal-deep); --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal); }
.btn-outline-primary { --bs-btn-color: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal); --bs-btn-hover-border-color: var(--teal); --bs-btn-active-bg: var(--teal-dark); }
.text-bg-primary, .bg-primary { background-color: var(--teal) !important; }
.text-primary { color: var(--teal) !important; }
.form-control:focus, .form-select:focus { border-color: #5eead4; box-shadow: 0 0 0 .2rem rgba(13,148,136,.2); }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.page-link { color: var(--teal-dark); }
.active > .page-link, .page-link.active { background-color: var(--teal); border-color: var(--teal); }

/* Sidebar */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--teal-deep); color: #d1fae5; overflow-y: auto; z-index: 1040; transition: transform .25s; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; background: rgba(0,0,0,.15); color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .3px; }
.sidebar .brand img { height: 36px; width: 36px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }
.sidebar .brand .logo-icon { height: 36px; width: 36px; border-radius: 8px; background: var(--teal); display: grid; place-items: center; font-size: 1.2rem; }
.sidebar .brand span { font-size: .95rem; line-height: 1.15; }
.sidebar .menu { list-style: none; padding: .5rem 0 2rem; margin: 0; }
.sidebar .menu .label { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: #5eead4; padding: .9rem 1.2rem .3rem; opacity: .8; }
.sidebar .menu a { display: flex; align-items: center; gap: .7rem; padding: .55rem 1.2rem; color: #ccfbf1; text-decoration: none; border-left: 3px solid transparent; }
.sidebar .menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .menu a.active { background: rgba(45,212,191,.15); border-left-color: #2dd4bf; color: #fff; font-weight: 600; }
.sidebar .menu a i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .submenu { list-style: none; padding: 0; margin: 0; background: rgba(0,0,0,.12); }
.sidebar .submenu a { padding-left: 3.1rem; font-size: .87rem; }
.sidebar .menu a .caret { margin-left: auto; transition: transform .2s; font-size: .75rem; }
.sidebar .menu a[aria-expanded="true"] .caret { transform: rotate(90deg); }

/* Main area */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: .6rem 1.25rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 1030; }
.topbar .page-title { font-weight: 600; font-size: 1.05rem; margin: 0; }
.topbar .user img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.content { padding: 1.25rem; flex: 1; }
.footer { padding: .8rem 1.25rem; color: #6b7280; font-size: .8rem; border-top: 1px solid #e5e7eb; background: #fff; }

.card { border: 0; border-radius: .75rem; box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid #eef2f2; font-weight: 600; padding: .85rem 1.1rem; border-radius: .75rem .75rem 0 0 !important; }
.card-header .btn { font-weight: 500; }

/* Stat tiles */
.stat { border-radius: .75rem; padding: 1rem 1.1rem; background: #fff; display: flex; align-items: center; gap: .9rem; box-shadow: 0 1px 3px rgba(16,24,40,.06); height: 100%; }
.stat .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--teal-light); color: var(--teal-dark); flex-shrink: 0; }
.stat .val { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: #6b7280; font-size: .8rem; }
.stat.warn .ico { background: #fef3c7; color: #b45309; }
.stat.danger .ico { background: #fee2e2; color: #b91c1c; }
.stat.info .ico { background: #e0f2fe; color: #0369a1; }

.table > :not(caption) > * > * { padding: .55rem .6rem; vertical-align: middle; }
.table thead th { background: var(--teal-soft); color: var(--teal-deep); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; background: #eee; }
.required::after { content: ' *'; color: #dc2626; }
.preg-bar { background: var(--teal-soft); border: 1px solid var(--teal-light); border-radius: .75rem; }
.progress-bar { background-color: var(--teal); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #134e4a 0%, #0d9488 60%, #5eead4 100%); padding: 16px; }
.login-card { width: 100%; max-width: 400px; border-radius: 1rem; }

/* Invoice */
.invoice { background: #fff; max-width: 850px; margin: 0 auto; padding: 2rem; border-radius: .75rem; }
.invoice .inv-head { border-bottom: 3px solid var(--teal); padding-bottom: 1rem; margin-bottom: 1rem; }

.select2-container--bootstrap-5 .select2-selection { min-height: calc(1.5em + .75rem + 2px); }
div.dataTables_wrapper div.dataTables_filter input { width: 180px; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sb-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    body.sb-open .sb-backdrop { display: block; }
}
.sb-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }

@media print {
    .sidebar, .topbar, .footer, .no-print, .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info, .dt-buttons { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; }
    body { background: #fff; }
}
