/* ================================
   app.css (BASE + DASHBOARD)
   Modern Light UI (Bootstrap 5)
   ================================ */

:root{
  --bg:
    radial-gradient(900px circle at 12% 18%, rgba(110,231,183,.42), transparent 55%),
    radial-gradient(900px circle at 86% 16%, rgba(147,197,253,.55), transparent 55%),
    radial-gradient(900px circle at 72% 86%, rgba(251,191,36,.26), transparent 62%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 55%, #f5f7ff 100%);

  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(15,23,42,.10);
  --border-strong: rgba(15,23,42,.14);

  --surface: rgba(255,255,255,.76);
  --surface-2: rgba(255,255,255,.62);

  --shadow: 0 20px 60px rgba(15,23,42,.12);
  --shadow-2: 0 12px 30px rgba(15,23,42,.10);

  --radius: 22px;

  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: rgba(37,99,235,.10);
}

html, body{ height: 100%; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Subtle waves texture */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  background-image: url("/static/img/waves.svg");
  background-size: cover;
  background-position: center;
  opacity: .55;
  pointer-events: none;
  z-index: -1;
}

/* Floating blur blobs */
body::after{
  content:"";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(600px circle at 20% 30%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(650px circle at 80% 30%, rgba(16,185,129,.10), transparent 60%),
    radial-gradient(700px circle at 60% 80%, rgba(245,158,11,.09), transparent 62%);
  filter: blur(14px);
  animation: floatBg 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -2;
}

@keyframes floatBg{
  from{ transform: translate3d(-12px,-10px,0) scale(1.02); }
  to{ transform: translate3d(14px,12px,0) scale(1.06); }
}

a{ color: var(--text); text-decoration: none; }
a:hover{ color: #0b1220; }

/* Shell spacing (account for fixed nav on logged-out pages) */
.app-shell{
  padding-top: 78px;
  min-height: calc(100vh - 120px);
}

/* Buttons / forms */
.btn{ border-radius: 14px; font-weight: 800; }
.btn-primary{
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 14px 34px rgba(37,99,235,.22);
}
.btn-primary:hover{
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
}
.btn-outline-secondary{
  border-color: rgba(15,23,42,.22);
}

.form-control, .form-select{
  border-radius: 14px;
  border-color: var(--border-strong);
  background: rgba(255,255,255,.86);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 .25rem rgba(37,99,235,.12);
}

/* Glass helper */
.glass{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
}

/* Tables */
.table{ color: var(--text); }
.table thead th{
  color: rgba(15,23,42,.78);
  border-color: var(--border);
}
.table td, .table th{ border-color: var(--border); }

/* Footer */
.footer{
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(12px);
}
.footer .text-muted{ color: rgba(15,23,42,.60) !important; }

/* Modal */
.modal-content{
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.92);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* ================================
   DASHBOARD
   ================================ */

.dash-layout{
  display: flex;
  min-height: 100vh;
}

.dash-sidebar{
  width: 268px;
  padding: 18px 16px;
  display:flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  gap: 14px;
  background: rgba(255,255,255,.62);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.dash-offcanvas{
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(14px);
}

.dash-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 6px 8px 10px;
}

.dash-logo{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.18);
  color: var(--accent);
}

.dash-account{
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border: 1px solid var(--border);
}

.dash-main{
  flex: 1;
  padding: 18px 18px 38px;
}

.dash-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.62);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-2);
  margin-bottom: 16px;
}

.dash-title{
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.dash-subtitle{
  font-size: .9rem;
  color: rgba(15,23,42,.62);
}

.dash-content{ margin-top: 12px; }

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
}
 
.sidebar-nav .nav-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  color: rgba(15,23,42,.84);
  border: 1px solid transparent;
}

.sidebar-nav .nav-item i{ font-size: 1.05rem; opacity: .9; }
.sidebar-nav .nav-item span{ font-weight: 700; }

.sidebar-nav .nav-item:hover{
  background: rgba(255,255,255,.60);
  border-color: rgba(15,23,42,.08);
}

.sidebar-nav .nav-item.active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.18);
  color: rgba(15,23,42,.95);
}

.sidebar-divider{
  height: 1px;
  background: rgba(15,23,42,.10);
  margin: 10px 6px;
}

/* Dashboard user chip (topbar) */
.sg-userchip{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 10px 26px rgba(15,23,42,.08);
  backdrop-filter: blur(12px);
}
.sg-userchip .av{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.16);
  color: var(--accent);
  font-weight: 900;
}
.sg-userchip .meta{ line-height: 1.05; }
.sg-userchip .k{
  font-size: .72rem;
  font-weight: 900;
  color: rgba(15,23,42,.55);
  text-transform: uppercase;
  letter-spacing: .10em;
}
.sg-userchip .v{
  font-size: .92rem;
  font-weight: 900;
  color: rgba(15,23,42,.88);
  max-width: 220px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stat cards used in dashboard.html */
.stat-card{
  background: rgba(255,255,255,.75);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-2);
}
.stat-value{
  font-weight: 900;
  font-size: 1.25rem;
}
.stat-label{
  color: rgba(15,23,42,.65);
  font-size: .9rem;
}
body.landing .ready-card{
  border-radius: 26px;
  background: rgba(255,255,255,.38);   /* minimal + transparent */
  border: 1px solid rgba(15,23,42,.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(15,23,42,.06); /* very soft */
}
/* medium width modal */
.logout-md{
  max-width: 520px;   /* medium size */
  width: calc(100% - 24px);
  margin: 0 auto;
}

.logout-card{
  border-radius: 18px;
}

/* One-screen landing (no scroll) */
body.landing .sg-hero--onepage{
  min-height: 100vh;
  padding: 2.5rem 0;
}

/* Tighten sections and cards */
body.landing .sg-section--compact{
  padding: 0;
}

body.landing .sg-card--compact{
  padding: 1rem 1rem;
}

body.landing .sg-preview--compact .sg-preview-body{
  padding: 0.75rem 1rem 1rem;
}

/* Reduce big default margins if your styles add them */
body.landing .sg-feat-wrap{
  margin-top: 1rem !important;
}
.stat-card[role="button"]:hover{
    transform: translateY(-1px);
    transition: 120ms ease;
  }
 
  /* Fixed dashboard panels: do not expand, scroll inside */
  .dash-fixed {
    height: 300px;           /* same height for Recent/Folders/Clients */
    overflow: hidden;        /* prevent card from expanding */
    display: flex;
    flex-direction: column;
  }
 
  .dash-fixed-sm {
    height: 300px;           /* for Shared panel */
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* flex children must be allowed to shrink, otherwise scrolling won't work */
  .dash-fixed .dash-panel-body,
  .dash-fixed-sm .dash-panel-body {
    min-height: 0;
    flex: 1 1 auto;
  }

  /* scroll container inside the card */
  .dash-scroll {
    overflow: auto;
    min-height: 0;
    flex: 1 1 auto;
  }

  /* Make stat cards clickable nicely */
  a.stat-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
  }
  .stat-card[role="button"] { cursor: pointer; }
  .stat-card[role="button"]:hover{
    transform: translateY(-1px);
    transition: 120ms ease;
  }

.stat-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.stat-link .stat-card {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.stat-link:hover .stat-card {
  transform: translateY(-2px);
}

.stat-link:focus-visible .stat-card {
  outline: 2px solid rgba(13,110,253,.6); /* bootstrap primary-ish */
  outline-offset: 2px;
}
/* all 3 cards same height */
.action-card{
  min-height: 170px;                 /* adjust as you like */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.action-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.10);
  border-color: rgba(13,110,253,0.25);
}

.action-card:active{ transform: translateY(-1px); }

.action-card:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(13,110,253,0.25), 0 14px 32px rgba(0,0,0,0.10);
}

.card-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 10px 12px;
}

/* ICON in center (looks like attractive badge) */
.icon-bubble{
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(13,110,253,0.10);
}

.icon-bubble i{
  font-size: 26px;
}

.card-title{
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px;
}

.card-subtitle{
  font-size: 13px;
  color: rgba(0,0,0,0.55);
}

.card-value{
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
}
.search-wrap { min-width: 260px; }

.search-input{
  position: relative;
  width: 300px;
  max-width: 100%;
}

.search-input i{
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(0,0,0,0.45);
  pointer-events: none;
}
 
.search-input input{
  padding-left: 38px;   /* space for icon */
  border-radius: 14px;
}
/* ================================
   RESPONSIVE DASHBOARD (PATCH)
   Paste at END of app.css
   ================================ */

/* On mobile/tablet: sidebar should not be sticky 100vh */
@media (max-width: 991.98px){
  .dash-layout{
    display:block;                 /* stop flex layout forcing sidebar height issues */
    min-height:auto;
  }

  .dash-sidebar{
    position: static;
    height: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    display: none !important;      /* keep desktop sidebar hidden on mobile */
  }

  .dash-main{
    padding: 14px 14px 24px;       /* tighter spacing */
  }
}

/* Add safe padding for very small phones */
@media (max-width: 575.98px){
  .dash-main{
    padding: 12px 12px 22px;
  }
}
/* Dashboard search should become full width on mobile */
@media (max-width: 575.98px){
  .search-wrap{
    min-width: 0 !important;
    width: 100%;
  }
  .search-input{
    width: 100% !important;
  }
}
/* ================================
   HORIZONTAL SCROLL INSIDE CARDS
   ================================ */
.dash-panel .table-responsive{
  width: 100%;
  overflow-x: auto;                 /* horizontal scroll */
  -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
}
 
/* Prevent table from shrinking too much */
.dash-panel table{
  min-width: 720px;                 /* adjust if needed */
}

/* If any list-group rows overflow, keep them clipped */
.dash-panel .list-group-item{
  overflow-x: auto;
}

/* Fixed panels should be auto height on small screens */
@media (max-width: 991.98px){
  .dash-fixed,
  .dash-fixed-sm{
    height: auto !important;
    overflow: visible !important;
  }

  .dash-scroll{
    overflow: visible !important;
  }

  .dash-table-scroll{
    max-height: none !important;
    overflow: visible !important;
  }
}
/* =========================
   CLIENTS PAGE RESPONSIVE
   ========================= */

/* Top bar: make search + button stack on mobile */
@media (max-width: 575.98px){
  /* this targets the 2nd row container (search + add button) */
  .d-flex.align-items-center.gap-2.w-100.justify-content-end{
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  /* make input group full width */
  .d-flex.align-items-center.gap-2.w-100.justify-content-end .input-group{
    max-width: 100% !important;
    width: 100% !important;
  }

  /* make Add client button full width */
  .d-flex.align-items-center.gap-2.w-100.justify-content-end .btn.btn-primary{
    width: 100% !important;
  }
}


/* Give table a minimum width so it scrolls instead of squeezing badly */
#clientsTable{
  min-width: 780px;
}

/* Optional: keep long email from breaking layout */
#clientsTable td{
  white-space: nowrap;
}
#clientsTable td:first-child{
  white-space: normal; /* allow name/email block to wrap */
}
@media (max-width: 575.98px){
  #addClientModal .col-6{
    flex: 0 0 100%;
    max-width: 100%;
  }
}
 /* Mobile: sidebar offcanvas should be usable */
@media (max-width: 991.98px){
  .dash-layout{ display: block; }
  .dash-main{ padding: 14px 14px 24px; }
}
.text-success {
  font-size: 15px;}.modal { z-index: 3000 !important; }
.modal-backdrop { z-index: 2990 !important; }
/* scroll container bottom bar */
.card.glass .excel-scroll{
  overflow-x: auto !important;
  overflow-y: auto;                 /* keep your vertical scroll */
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/*  THE REAL FIX: override bootstrap .table{width:100%} */
.card.glass table.excel-table{
  width: max-content !important;    /* do NOT fit container */
  min-width: 100% !important;       /* at least full width */
  table-layout: auto !important;    /* natural column sizing */
}

/* prevent wrapping so the table becomes wide -> scrollbar appears */
.card.glass table.excel-table th,
.card.glass table.excel-table td{
  white-space: nowrap !important;
}
/* Modern icon button */
.notif-btn{
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;             /* “app icon” feel */
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  display: grid;
  place-items: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.notif-btn i{
  font-size: 1.15rem;
  opacity: .9;
}

.notif-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
  background: #0d6efd;
}

.notif-btn:active{ transform: translateY(0); } 

.notif-btn:focus-visible{
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(13,110,253,.18), 0 10px 28px rgba(0,0,0,.12);
}

/* Badge */
.notif-badge{
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #ff3b30; /* iOS-like red */
  border: 2px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
  transform: scale(.92);
  transform-origin: center;
  animation: notifPop .18s ease-out;
}

@keyframes notifPop{
  from{ transform: scale(.6); }
  to{ transform: scale(.92); }
}

@media (prefers-reduced-motion: reduce){
  .notif-btn, .notif-badge{ transition:none; animation:none; }
}
