/* ============================================================
   SNS Worktime Sheet — Sheth & Shah CA
   app.css  — Custom styles on top of Bootstrap 5
   ============================================================ */

:root {
  --navy:  #0a1628;
  --navy2: #112040;
  --navy3: #1a3060;
  --gold:  #c9a84c;
  --gold2: #e8c46a;
  --blue:  #1e4db7;
  --blue2: #2563eb;
  --green: #059669;
  --red:   #dc2626;
  --sidebar-width: 240px;
  --topbar-height: 52px;
}

/* ── Typography ───────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--navy);
  margin: 0;
}

/* ── Layout ───────────────────────────────────────────────── */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

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

/* ── Sidebar ──────────────────────────────────────────────── */
.sns-sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  transition: width 0.25s ease;
  position: relative;
  z-index: 200;
}

.sns-sidebar.collapsed {
  width: 58px;
}

.sns-sidebar.collapsed .sb-text {
  display: none !important;
}

.s-logo {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.s-logo-ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.s-logo-txt {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.s-logo-sub {
  color: rgba(255,255,255,0.4);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.s-nav {
  padding: 8px 6px;
  overflow-y: auto;
}

.s-sec {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 8px 3px;
  white-space: nowrap;
}

.s-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 2px;
  text-align: left;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}

.s-btn:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}

.s-btn.active {
  background: rgba(201,168,76,0.18);
  color: var(--gold2);
  font-weight: 700;
  border: 1px solid rgba(201,168,76,0.25);
}

.s-ic {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.s-foot {
  padding: 8px 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.s-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 5px;
}

.s-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

.s-uname {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-urole {
  font-size: 10px;
  color: var(--gold);
  white-space: nowrap;
}

.s-logout {
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.s-logout:hover {
  background: rgba(220,38,38,0.15);
  color: #f87171;
  border-color: rgba(220,38,38,0.3);
}

/* Sidebar overlay for mobile */
#sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.5);
  z-index: 150;
}

#sb-overlay.show { display: block; }

/* ── Topbar ───────────────────────────────────────────────── */
.sns-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  height: var(--topbar-height);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
}

.h-ham {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  cursor: pointer;
}

.h-ham:hover { background: #f1f5f9; }

.h-bread { font-size: 13px; color: #64748b; }

.h-firm {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}

.h-firm span { color: var(--gold); }

/* ── Cards ────────────────────────────────────────────────── */
.card { border-radius: 14px !important; }
.card-header { border-radius: 14px 14px 0 0 !important; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { border-radius: 9px !important; font-weight: 600; font-size: 13px; }
.btn-xs { padding: 3px 7px; font-size: 11px; border-radius: 6px !important; }
.btn-primary { background: var(--blue2); border-color: var(--blue2); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }

/* ── Stat cards ───────────────────────────────────────────── */
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ── Team avatar ──────────────────────────────────────────── */
.team-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Assignment blocks (client form) ─────────────────────── */
.assignment-block {
  background: #f8fafc;
  border-radius: 9px;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  transition: border-color 0.15s;
}
.assignment-block.active { background: #fff; }
.cursor-pointer { cursor: pointer; }

/* ── Timesheet table ─────────────────────────────────────── */
.ts-table {
  font-size: 12px;
  min-width: 1100px;
}

.ts-table th, .ts-table td {
  vertical-align: middle;
}

.ts-th-red   { background: #c0504d; color: #fff; padding: 7px 8px; }
.ts-th-blue  { background: #95b3d7; color: #111; padding: 7px 8px; }
.ts-th-teal  { background: #4bacc6; color: #fff; padding: 7px 8px; }
.ts-th-green { background: #9bbb59; color: #fff; padding: 7px 8px; }
.ts-th-gray  { background: #d6d6d6; color: #555; padding: 7px 8px; }

.ts-input {
  width: 100%;
  padding: 4px 6px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  color: #0f172a;
  height: 30px;
}
.ts-input:focus {
  background: #fffbeb;
  outline: 1px solid var(--gold);
}
.ts-time {
  font-family: monospace;
  text-align: center;
  width: 82px;
}

.ts-select {
  width: 100%;
  padding: 3px 4px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  color: #0f172a;
  cursor: pointer;
  height: 30px;
}

/* Timesheet row states */
.ts-holiday td { background: #dcfce7 !important; }
.ts-leave td   { background: #fce7f3 !important; }
.ts-half td    { background: #fef9c3 !important; }
.ts-saturday td{ background: #f0e6ff !important; }
.ts-today td   { outline: 2px solid #2563eb; outline-offset: -1px; }

/* Timesheet legend dots */
.ts-legend {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.ts-legend.ts-holiday { background: #dcfce7; border: 1px solid #86efac; }
.ts-legend.ts-leave   { background: #fce7f3; border: 1px solid #f9a8d4; }
.ts-legend.ts-half    { background: #fef9c3; border: 1px solid #fde68a; }
.ts-legend.ts-saturday{ background: #f0e6ff; border: 1px solid #d8b4fe; }

/* ── Filing table ─────────────────────────────────────────── */
.filing-table { min-width: 900px; font-size: 11px; }
.filing-cell-select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 2px;
  text-align: center;
}
.filing-cell-select:focus { outline: 1px solid var(--gold); background: #fffbeb; }

/* ── Toast notifications ─────────────────────────────────── */
.sns-toast {
  background: #059669;
  color: #fff;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  margin-top: 8px;
  animation: toastIn 0.25s ease;
  min-width: 200px;
}
.sns-toast.error  { background: #dc2626; }
.sns-toast.warn   { background: #d97706; }
.sns-toast.info   { background: #2563eb; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Login page ───────────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy3) 60%, var(--navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrap {
  display: flex;
  width: 100%;
  max-width: 860px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}

.login-left {
  background: linear-gradient(160deg, var(--navy2), var(--navy3));
  padding: 44px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.2);
}

.ll-icon  { font-size: 44px; margin-bottom: 14px; }
.ll-name  { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 900; color: var(--gold); line-height: 1.2; }
.ll-sub   { font-size: 13px; color: rgba(255,255,255,0.55); margin-top: 5px; letter-spacing: 0.4px; }
.ll-copy  { font-size: 11px; color: rgba(255,255,255,0.3); line-height: 1.6; margin-top: 24px; }

.ll-feat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin-bottom: 10px;
}

.ll-feat-ic {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(201,168,76,0.2);
  border: 1px solid rgba(201,168,76,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}

.login-right {
  background: #fff;
  padding: 44px 38px;
  width: 360px;
  flex-shrink: 0;
}

.lr-title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 900; color: var(--navy); margin-bottom: 5px; }
.lr-sub   { font-size: 13px; color: #64748b; margin-bottom: 28px; }

.l-label {
  font-size: 11px; font-weight: 700; color: #334155;
  display: block; margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.l-input {
  width: 100%; padding: 11px 14px;
  border-radius: 9px; border: 1.5px solid #e2e8f0;
  font-size: 14px; margin-bottom: 14px;
  transition: border-color 0.2s; color: #0f172a;
  font-family: 'DM Sans', sans-serif;
}
.l-input:focus { border-color: var(--blue2); outline: none; }

.l-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--navy), var(--blue2));
  color: #fff; border: none;
  border-radius: 9px; font-size: 15px;
  font-weight: 700; margin-top: 4px;
  cursor: pointer; transition: transform 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.l-btn:hover { transform: translateY(-1px); }

.l-hint {
  font-size: 11px; color: #64748b;
  text-align: center; margin-top: 14px;
  padding: 10px; background: #f1f5f9;
  border-radius: 9px; line-height: 1.6;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  body { overflow: auto; display: block; }

  .sns-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 500;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: 6px 0 30px rgba(0,0,0,0.3);
  }

  .sns-sidebar.mobile-open { transform: translateX(0); }
  .sns-sidebar.collapsed   { width: 240px; transform: translateX(-100%); }

  #main-wrap { width: 100%; height: auto; overflow: visible; }
  #content   { overflow: visible; padding: 12px; }

  .login-left  { display: none !important; }
  .login-right { width: 100%; padding: 32px 24px; }
  .login-wrap  { flex-direction: column; max-width: 420px; }
  .page-title  { font-size: 18px; }
}

@media (max-width: 480px) {
  .sns-header .h-firm { display: none; }
}
