/* =========================================
   DocSmartly — Final Premium Stylesheet
   ========================================= */

:root {
  --bg: #f6f8fb;
  --sf: #ffffff;
  --ink: #0f172a;
  --mut: #64748b;
  --ac: #2563eb;
  --ac2: #1d4ed8;
  --ln: #e5e9f0;
  --tint: #eef4ff;
  --er: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 12px rgba(15, 23, 42, .05);
  --shadow-md: 0 18px 40px -18px rgba(15, 23, 42, .25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 94%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0;
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3.2vw, 2.1rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 650; }

a {
  color: inherit;
  text-decoration: none;
}

p { margin: 0; }

.w {
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.sec {
  padding-block: clamp(42px, 7vw, 76px);
}

/* Header */
header,
.ap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ln);
  box-shadow: 0 6px 24px -16px rgba(15, 23, 42, .22);
}

header .w,
.ap .w {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
}

.logo .lt {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border-radius: 10px;
  padding: 7px 11px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
}

nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: .92rem;
  font-weight: 650;
  color: var(--mut);
}

nav a {
  transition: color .2s ease;
}

nav a:hover {
  color: var(--ac);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  min-height: 46px;
  font: 700 .95rem "Plus Jakarta Sans", system-ui, sans-serif;
  color: #fff;
  background: var(--ac);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .22);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
  background: var(--ac2);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -8px rgba(37, 99, 235, .45);
}

.btn:active {
  transform: scale(.97);
}

.btn.o {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ln);
  box-shadow: var(--shadow-sm);
}

.btn.o:hover {
  background: var(--tint);
  border-color: #bfd3fe;
  color: var(--ac2);
}

/* Inputs */
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--sf);
  border: 1.5px solid var(--ln);
  border-radius: 12px;
  color: var(--ink);
  font: 500 max(16px, .95rem) "Plus Jakarta Sans", system-ui, sans-serif;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--sf);
  border: 1px solid var(--ln);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: #bfd3fe;
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin-top: 8px;
  font-size: .98rem;
  text-transform: capitalize;
}

.card p {
  margin-top: 4px;
  color: var(--mut);
  font-size: .84rem;
}

/* Badges */
.pr,
.badge-free {
  display: inline-block;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, .25);
}

.badge-paid,
.pr:not(.fre) {
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  box-shadow: none;
}

.rk {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

/* Tool visuals */
.sv,
.tl {
  position: relative;
  aspect-ratio: 16 / 10;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(rgba(15, 23, 42, .06) 1px, transparent 1.5px) 0 0 / 12px 12px,
    linear-gradient(135deg, var(--t, #eef4ff), #fff);
}

.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .16));
}

.fa { fill: var(--a); }
.fb { fill: var(--b); }
.fw { fill: #fff; }
.fl { fill: #dbe4f3; }
.fk { fill: #0f172a; }
.fy { fill: #f5c451; }
.fg { fill: #16a34a; }
.fr { fill: #dc2626; }
.fm { fill: #8a93a6; }
.fo { fill: #fff; fill-opacity: .4; }

.sa {
  fill: none;
  stroke: var(--a);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sw {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Category filters */
.cats,
.dash-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 18px;
}

.cats button,
.dash-cats button {
  min-height: 42px;
  padding: 9px 18px;
  border: 1.5px solid var(--ln);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: 700 .86rem "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}

.cats button:hover,
.dash-cats button:hover {
  border-color: #bfd3fe;
  color: var(--ac2);
  background: var(--tint);
}

.cats button.on,
.dash-cats button.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Dashboard layout */
.shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
}

.apm {
  min-width: 0;
  padding: 34px 34px 80px;
}

/* Sidebar */
.sb {
  position: sticky;
  top: 69px;
  height: calc(100vh - 69px);
  display: flex;
  flex-direction: column;
  background: #fbfcfe;
  border-right: 1px solid var(--ln);
  z-index: 10;
}

.sbs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.mi {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #475569;
  font: 600 .93rem "Plus Jakarta Sans", system-ui, sans-serif;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
}

.mi:hover {
  background: #eef2f7;
  color: var(--ink);
}

.mi.active {
  background: var(--tint);
  color: var(--ac2);
  font-weight: 700;
}

.sbf {
  padding: 12px;
  border-top: 1px solid var(--ln);
}

.sb-category {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ln);
}

.sb-group {
  margin-bottom: 4px;
}

.sb-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.sb-group summary::-webkit-details-marker {
  display: none;
}

.sb-group summary:hover {
  background: var(--tint);
}

.sb-group summary em {
  font-style: normal;
  font-size: .72rem;
  color: var(--mut);
}

.sb-sub-list {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  padding-left: 6px;
}

.sb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--mut);
  font-size: .81rem;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s ease;
}

.sb-item:hover {
  background: var(--tint);
  color: var(--ac);
}

.sb-ic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sb-ic svg {
  width: 15px;
  height: 15px;
  color: var(--ac);
  flex: none;
}

/* Dashboard hero */
.gc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  padding: 36px;
  border-radius: 26px;
  color: #e3ebfb;
  background:
    radial-gradient(900px 320px at 88% -10%, rgba(37, 99, 235, .22), transparent),
    linear-gradient(135deg, #0b1220, #17233d);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-md);
}

.gc h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-top: 8px;
}

.gc p,
.gc small {
  color: #b9c7e2;
}

.gw {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.gw b {
  display: block;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
}

.gc .btn {
  background: #fff;
  color: var(--ink);
}

.gc .btn:hover {
  background: #f1f5f9;
  box-shadow: 0 12px 26px rgba(255, 255, 255, .16);
}

/* Dashboard stats */
.stt {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stt div {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  transition: all .2s ease;
}

.stt div:hover {
  background: rgba(255, 255, 255, .14);
  transform: translateY(-3px);
}

.stt b {
  display: block;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
}

.stt span {
  color: #b9c7e2;
  font-size: .82rem;
  font-weight: 600;
}

/* Dashboard tools */
.tools-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0 16px;
}

.tools-dash-head h2 {
  font-size: 1.5rem;
}

.dash-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
}

.dash-search-bar input {
  min-height: 44px;
  border-radius: 14px;
  font-size: .9rem;
}

/* Service sections */
.ds {
  margin-bottom: 24px;
  background: transparent;
  border: 0;
  padding: 0;
}

.ds summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--ln);
  border-radius: 16px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.ds summary em {
  font-style: normal;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ac2);
  font-size: .78rem;
  font-weight: 800;
}

.ig {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px 0 14px;
}

.it {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--ln);
  border-radius: 20px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.it:hover {
  transform: translateY(-5px);
  border-color: #bfd3fe;
  box-shadow: 0 22px 44px -22px rgba(15, 23, 42, .3);
}

.it h3 {
  font-size: .94rem;
  font-weight: 700;
  line-height: 1.35;
}

.it p {
  margin-top: 3px;
  color: var(--mut);
  font-size: .79rem;
}

.badge-free {
  background: #e8f7ef;
  color: #0f6b45;
  border: 1px solid #bfe7d1;
  box-shadow: none;
}

.badge-paid {
  background: #fff6e5;
  color: #8a5300;
  border: 1px solid #f2d9a4;
  box-shadow: none;
}

/* Tables */
.tw {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--ln);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.tw table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.tw th,
.tw td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--ln);
  text-align: left;
  font-size: .92rem;
}

.tw th {
  background: #f8fafc;
  color: var(--mut);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tw tbody tr:hover {
  background: #f8fafc;
}

.sb-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  text-transform: capitalize;
}

.s-pending {
  background: #fff6e5;
  color: #8a5300;
}

.s-processing {
  background: #e5edff;
  color: #1d4ed8;
}

.s-success {
  background: #e8f7ef;
  color: #0f6b45;
}

.s-failed {
  background: #fdecea;
  color: #991b1b;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.open,
.modal[style*="flex"] {
  display: flex;
}

.box {
  position: relative;
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 30px;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .3);
}

.x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: all .2s ease;
}

.x:hover {
  background: #dbeafe;
  color: var(--ac);
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 20px;
  z-index: 200;
  padding: 14px 22px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 650;
  font-size: .92rem;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .3);
  transition: all .3s cubic-bezier(.16, 1, .3, 1);
}

#toast.on {
  opacity: 1;
  translate: -50% 0;
}

/* Mobile */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sb {
    position: relative;
    top: 0;
    height: auto;
    margin-bottom: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--ln);
  }

  .apm {
    padding: 20px 16px 64px;
  }

  .gc {
    padding: 24px;
    border-radius: 20px;
  }

  .gc h1 {
    font-size: 1.45rem;
  }

  .it {
    border-radius: 16px;
  }
}

@media (max-width: 820px) {
  nav {
    display: none;
  }
}

button,
.mi,
.it,
.chip {
  min-height: 44px;
  touch-action: manipulation;
}
