/* ============================================================
   JagoTech Client Portal — Stylesheet
   Theme: Clean White + Teal #0F6E56 accent
   Font: Hind Siliguri (Bengali) + Exo 2 (Display)
   Mobile-first, Bootstrap 5 companion
   ============================================================ */

:root {
    --teal:        #0F6E56;
    --teal-dark:   #0A5240;
    --teal-light:  #E8F5F1;
    --teal-mid:    #C8E8DF;
    --orange:      #FF6B00;
    --orange-light:#FFF1E6;
    --white:       #FFFFFF;
    --bg:          #F4F6F9;
    --card-bg:     #FFFFFF;
    --text-dark:   #1A2332;
    --text-mid:    #4A5568;
    --text-muted:  #8899AA;
    --border:      #E2E8F0;
    --danger:      #DC2626;
    --success:     #16A34A;
    --warning:     #D97706;
    --radius:      12px;
    --radius-sm:   8px;
    --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg:   0 4px 20px rgba(0,0,0,0.12);
    --transition:  0.2s ease;
    --font-body:   'Hind Siliguri', sans-serif;
    --font-display:'Exo 2', sans-serif;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* ============================================================
   NAVBAR
   ============================================================ */
.jt-navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 10px 0;
}

.jt-logo {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
}
.logo-jago { color: var(--text-dark); }
.logo-tech { color: var(--teal); }
.logo-sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 6px;
    align-self: center;
}

.jt-navbar .nav-link {
    color: var(--text-mid) !important;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 12px !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    position: relative;
}
.jt-navbar .nav-link:hover { color: var(--teal) !important; background: var(--teal-light); }
.jt-navbar .nav-link.active { color: var(--teal) !important; background: var(--teal-light); font-weight: 600; }

/* Unread badge */
.badge-msg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50px;
    padding: 0 4px;
    margin-left: 4px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.jt-main {
    flex: 1;
    padding: 24px 0 40px;
}

.page-header {
    margin-bottom: 24px;
}
.page-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}
.page-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.jt-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.jt-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.jt-card-header h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-dark);
}

/* Summary / Stat Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-lg); }

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

.stat-icon-teal    { background: var(--teal-light); color: var(--teal); }
.stat-icon-orange  { background: var(--orange-light); color: var(--orange); }
.stat-icon-danger  { background: #FEE2E2; color: var(--danger); }
.stat-icon-success { background: #DCFCE7; color: var(--success); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1; }
.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

.jt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jt-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.jt-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-dark);
}

.jt-table tbody tr:last-child td { border-bottom: none; }
.jt-table tbody tr:hover { background: var(--bg); }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-active   { background: #DCFCE7; color: #15803D; }
.badge-paused   { background: #FEF3C7; color: #92400E; }
.badge-ended    { background: #F1F5F9; color: #64748B; }
.badge-pending  { background: #EDE9FE; color: #5B21B6; }
.badge-completed{ background: #DCFCE7; color: #15803D; }
.badge-cancelled{ background: #FEE2E2; color: #991B1B; }

/* ============================================================
   FORMS
   ============================================================ */
.jt-input {
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 10px 14px !important;
    font-family: var(--font-body) !important;
    font-size: 0.9rem !important;
    color: var(--text-dark) !important;
    background: var(--white) !important;
    min-height: 44px;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition) !important;
}
.jt-input:focus {
    border-color: var(--teal) !important;
    box-shadow: 0 0 0 3px rgba(15,110,86,0.1) !important;
    outline: none;
}

.jt-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 5px;
    display: block;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-jt-primary {
    background: var(--teal);
    color: var(--white) !important;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 10px 20px;
    min-height: 44px;
    transition: all var(--transition);
    font-family: var(--font-body);
}
.btn-jt-primary:hover { background: var(--teal-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,110,86,0.3); }

.btn-jt-outline {
    background: transparent;
    color: var(--teal) !important;
    border: 1.5px solid var(--teal);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 10px 20px;
    min-height: 44px;
    transition: all var(--transition);
    font-family: var(--font-body);
}
.btn-jt-outline:hover { background: var(--teal); color: var(--white) !important; }

/* ============================================================
   MESSAGES / CHAT
   ============================================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    scroll-behavior: smooth;
}

.chat-bubble {
    display: flex;
    gap: 10px;
    max-width: 80%;
}
.chat-bubble.client { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble.admin  { align-self: flex-start; }

.bubble-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.bubble-avatar.client-av { background: var(--teal); color: #fff; }
.bubble-avatar.admin-av  { background: var(--text-dark); color: #fff; }

.bubble-body { display: flex; flex-direction: column; gap: 4px; }

.bubble-text {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.chat-bubble.client .bubble-text { background: var(--teal); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-bubble.admin .bubble-text  { background: var(--white); color: var(--text-dark); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; }

.bubble-time { font-size: 0.72rem; color: var(--text-muted); }
.chat-bubble.client .bubble-time { text-align: right; }

/* ============================================================
   BALANCE / LEDGER
   ============================================================ */
.balance-display {
    text-align: center;
    padding: 32px;
    border-radius: var(--radius);
    border: 2px solid;
    margin-bottom: 24px;
}
.balance-display.positive { background: #DCFCE7; border-color: #86EFAC; }
.balance-display.negative { background: #FEE2E2; border-color: #FCA5A5; }
.balance-amount {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}
.balance-display.positive .balance-amount { color: var(--success); }
.balance-display.negative .balance-amount { color: var(--danger); }
.balance-label { font-size: 0.875rem; color: var(--text-muted); margin-top: 8px; }

/* Credit / Debit coloring in tables */
.amount-credit { color: var(--success); font-weight: 600; }
.amount-debit  { color: var(--danger);  font-weight: 600; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert-jt { border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.875rem; }
.alert-jt-success { background: #DCFCE7; border: 1px solid #86EFAC; color: #15803D; }
.alert-jt-danger  { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B; }
.alert-jt-info    { background: #E0F2FE; border: 1px solid #7DD3FC; color: #0369A1; }

/* ============================================================
   FOOTER
   ============================================================ */
.jt-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 0;
    margin-top: auto;
}

/* ============================================================
   PRINT STYLES (for invoice printing)
   ============================================================ */
@media print {
    .jt-navbar, .jt-footer, .no-print { display: none !important; }
    .jt-main { padding: 0 !important; }
    body { background: #fff !important; color: #000 !important; }
    .jt-card { box-shadow: none !important; border: 1px solid #ccc !important; }
    .jt-table tbody tr:hover { background: none !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .jt-main { padding: 16px 0 30px; }
    .jt-card  { padding: 16px; }
    .stat-card { padding: 16px; }
    .jt-table { font-size: 12px; }
    .jt-table thead th, .jt-table tbody td { padding: 10px 10px; }
    .balance-amount { font-size: 2rem; }
    .chat-container { max-height: 380px; }
    .chat-bubble { max-width: 90%; }
    .btn-jt-primary, .btn-jt-outline { width: 100%; }
}

@media (max-width: 576px) {
    .stat-value { font-size: 1.3rem; }
    .page-header h4 { font-size: 1.1rem; }
}
