/* ============================================================
   Pond Manager — Main Stylesheet (Asset Manager UI style)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
    --sidebar-bg:     #0f172a;
    --sidebar-hover:  rgba(255,255,255,0.05);
    --sidebar-active: rgba(8,145,178,0.15);
    --accent:         #0891b2;
    --accent-dark:    #0e7490;
    --body-bg:        #f1f5f9;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --text-primary:   #1e293b;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --success:        #059669;
    --danger:         #dc2626;
    --warning:        #d97706;
    --info:           #0891b2;
    --sidebar-width:  260px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

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

/* ================================================================
   LAYOUT
   ================================================================ */
.wrapper { display: flex; min-height: 100vh; }

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

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(8,145,178,0.4);
}
.sidebar-brand .brand-name {
    font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2;
}
.sidebar-brand .brand-sub {
    font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: .06em;
}

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    padding: 12px 20px 4px;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .18s;
    border-left: 3px solid transparent;
}
.sidebar-nav li a .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}
.sidebar-nav li a:hover {
    color: #e2e8f0;
    background: var(--sidebar-hover);
}
.sidebar-nav li.active > a {
    color: #67e8f9;
    background: var(--sidebar-active);
    border-left-color: var(--accent);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 13px;
    flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta .u-name { font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .u-role { font-size: 11px; color: #64748b; }
.btn-logout {
    color: #64748b; font-size: 16px; text-decoration: none;
    transition: color .2s; flex-shrink: 0;
}
.btn-logout:hover { color: #ef4444; }

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

.topbar {
    background: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.sidebar-toggle {
    background: none; border: none;
    color: var(--text-secondary); font-size: 18px;
    cursor: pointer; padding: 4px; display: none;
}
.page-heading { font-size: 18px; font-weight: 700; color: var(--text-primary); flex: 1; }
.topbar-meta { font-size: 12px; color: var(--text-muted); }

.content-area { padding: 24px; }

/* ── Overlay ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
/* alias for legacy card-soft class */
.card-soft {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h5, .card-header h6 { margin: 0; font-weight: 700; font-size: 14px; color: var(--text-primary); }
.card-body { padding: 20px; }

/* ── Stat Cards (gradient colored) ── */
.stat-card {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-radius: 14px;
    padding: 22px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.stat-card .sc-icon {
    font-size: 30px; opacity: .35;
    position: absolute; right: 20px; top: 50%;
    transform: translateY(-50%);
}
.stat-card .sc-label { font-size: 12px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .sc-value { font-size: 26px; font-weight: 800; margin-top: 6px; word-break: break-word; }
.stat-card .sc-sub   { font-size: 11px; opacity: .7; margin-top: 4px; }
.stat-card .stat-title { font-size: 12px; font-weight: 600; opacity: .85; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; word-break: break-word; color: inherit; }
.stat-card .profit-positive,
.stat-card .profit-negative { color: inherit !important; }

.sc-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.sc-teal   { background: linear-gradient(135deg, #0891b2, #0e7490); }
.sc-green  { background: linear-gradient(135deg, #059669, #047857); }
.sc-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.sc-amber  { background: linear-gradient(135deg, #d97706, #b45309); }
.sc-red    { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.sc-cyan   { background: linear-gradient(135deg, #06b6d4, #0891b2); }

/* ================================================================
   TABLES
   ================================================================ */
.table-responsive { border-radius: 0 0 12px 12px; }
.table { margin: 0; }
.table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-secondary);
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 13.5px;
    border-bottom: 1px solid #f8fafc;
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fffe; }
.table tfoot th { padding: 12px 16px; font-size: 13px; background: #f8fafc; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    letter-spacing: .02em;
}

/* ================================================================
   ACTION BUTTONS
   ================================================================ */
.btn-act {
    width: 30px; height: 30px;
    border: none; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; cursor: pointer;
    transition: all .18s;
    text-decoration: none;
}
.btn-act:hover { filter: brightness(.88); transform: scale(1.08); }
.btn-view   { background: #ecfdf5; color: #0891b2; }
.btn-edit   { background: #f0fdf4; color: #16a34a; }
.btn-delete { background: #fef2f2; color: #dc2626; }

/* ================================================================
   FORMS & MODALS
   ================================================================ */
.form-label { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-control, .form-select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    padding: 9px 12px;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(8,145,178,.12);
    outline: none;
}
.form-control::placeholder { color: #c0c8d4; }

.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.modal-body  { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: #fafbff; }
.modal-content { border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.15); }

/* ================================================================
   AMOUNTS
   ================================================================ */
.amount-pos     { color: #16a34a; font-weight: 700; }
.amount-neg     { color: #dc2626; font-weight: 700; }
.amount-neutral { color: var(--text-primary); font-weight: 600; }
.profit-positive { color: #16a34a !important; font-weight: 700; }
.profit-negative { color: #dc2626 !important; font-weight: 700; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-13  { font-size: 13px; }

/* ================================================================
   MISC
   ================================================================ */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 52px; margin-bottom: 14px; opacity: .4; }
.empty-state p { font-size: 14px; }

.page-actions {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px; flex-wrap: wrap; justify-content: space-between;
}
.page-actions h2 { font-size: 20px; font-weight: 800; margin: 0; }
.page-actions .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* section title/text compat */
.section-title { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.section-text  { font-size: 13px; color: var(--text-muted); margin-top: 2px; margin-bottom: 0; }

/* Toast area */
.toast-area { position: fixed; top: 20px; right: 20px; z-index: 9999; min-width: 280px; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 50%, #0f172a 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 400px;
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0,0,0,.4);
    overflow: hidden;
}
.login-card-top {
    background: linear-gradient(135deg, #0e7490, #0891b2);
    padding: 32px 32px 28px;
    text-align: center;
    color: #fff;
}
.login-logo-icon {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.18);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 14px;
}
.login-card-top h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.login-card-top p  { font-size: 13px; opacity: .8; margin: 0; }
.login-card-body   { padding: 32px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: block !important; }
    .sidebar-overlay.show { display: block; }
    .content-area { padding: 16px; }
}
@media (max-width: 576px) {
    .stat-card .sc-value,
    .stat-card .stat-value { font-size: 20px; }
    .page-actions { flex-direction: column; align-items: flex-start; }
    .login-card-body { padding: 24px; }
}
