:root {
  --blue: #1d5fd1;
  --blue2: #123f92;
  --blue3: #071d4f;
  --bg: #edf4ff;
  --card: #ffffff;
  --ink: #10213f;
  --muted: #64748b;
  --line: #d7e4f5;
  --green: #16a34a;
  --orange: #f97316;
  --red: #dc2626;
  --purple: #7c3aed;
  --cyan: #0ea5e9;
  --teal: #14b8a6;
  --shadow: 0 22px 52px -38px rgba(15, 36, 68, .9);
  --shadow-strong: 0 30px 70px -42px rgba(15, 36, 68, .95);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; background: linear-gradient(180deg, #f7fbff 0, var(--bg) 230px, #eef5ff 100%); color: var(--ink); font-size: 16px; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.topbar { position: sticky; top: 0; z-index: 20; background: linear-gradient(115deg, #0b2f77 0%, #1d5fd1 62%, #0f766e 140%); color: #fff; padding: 14px clamp(14px, 3vw, 28px); display: flex; justify-content: space-between; align-items: center; box-shadow: 0 18px 46px -28px rgba(7, 29, 79, .9); border-bottom: 1px solid rgba(255,255,255,.16); }
.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.brand-icon, .login-logo { width: 58px; height: 58px; border-radius: 20px; background: linear-gradient(145deg, rgba(255,255,255,.24), rgba(255,255,255,.08)); display: grid; place-items: center; font-size: 27px; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 16px 34px -26px rgba(0,0,0,.9); border: 1px solid rgba(255,255,255,.18); }
.brand h1 { margin: 0; font-size: clamp(18px, 3.2vw, 25px); line-height: 1.1; letter-spacing: 0; }
.brand p { margin: 5px 0 0; opacity: .88; font-size: 13px; font-weight: 650; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: none; font-size: 13px; opacity: .95; font-weight: 800; }
.icon-btn { color: #fff; background: rgba(255,255,255,.18); border-radius: 15px; padding: 10px 13px; box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.tabs { display: grid; grid-template-columns: repeat(5, minmax(92px, 1fr)); gap: 10px; padding: 12px clamp(8px, 2vw, 18px); background: rgba(237, 244, 255, .88); position: sticky; top: 86px; z-index: 15; overflow-x: auto; backdrop-filter: blur(14px); border-bottom: 1px solid rgba(215,228,245,.75); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { min-height: 64px; color: #284364; background: linear-gradient(180deg, #fff, #f9fbff); border: 1px solid rgba(215,228,245,.95); border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 850; font-size: 20px; box-shadow: 0 18px 34px -30px rgba(15,36,68,.8), inset 0 1px 0 rgba(255,255,255,.95); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tabs a:hover { transform: translateY(-2px); border-color: #b9cef0; box-shadow: 0 24px 42px -32px rgba(15,36,68,.95); }
.tabs span { font-size: 13px; line-height: 1.1; }
.tabs a.active { color: #fff; background: linear-gradient(135deg, #2b70dd, #184aa8); border-color: transparent; box-shadow: 0 22px 44px -30px rgba(29,95,209,.95), inset 0 1px 0 rgba(255,255,255,.22); }
.container { width: min(1180px, 100%); margin: 0 auto; padding: 24px 14px 96px; }
.panel, .hero, .login-card { background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,255,.96)); border: 1px solid rgba(215,228,245,.95); border-radius: 28px; padding: clamp(18px, 3vw, 26px); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.panel { position: relative; overflow: hidden; }
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, rgba(29,95,209,.9), rgba(20,184,166,.65), rgba(245,158,11,.55)); opacity: .75; pointer-events: none; }
.hero { background: linear-gradient(135deg, #1c5bc8 0%, #123f92 72%, #0f766e 140%); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; border-color: rgba(255,255,255,.16); box-shadow: 0 26px 60px -36px rgba(18,63,146,.95); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #38bdf8, #22c55e, #f59e0b); opacity: .95; }
.hero h2, .panel h2, .panel h3 { margin: 0 0 8px; letter-spacing: 0; }
.panel h2 { font-size: clamp(25px, 4vw, 38px); line-height: 1.12; color: #10213f; }
.panel h3 { font-size: clamp(18px, 2.6vw, 24px); }
.hero p, .muted { color: var(--muted); }
.hero p { color: rgba(255,255,255,.85); margin: 0; }
.menu-grid, .stat-grid, .filter-grid, .chart-grid { display: grid; gap: 12px; }
.menu-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; gap: 14px; }
.menu-card { min-height: 140px; padding: 22px; border-radius: 24px; background: #fff; border: 1px solid rgba(215,228,245,.9); display: flex; flex-direction: column; justify-content: center; gap: 10px; box-shadow: 0 20px 42px -34px rgba(15,36,68,.85), inset 0 1px 0 rgba(255,255,255,.95); transition: transform .16s ease, box-shadow .16s ease; position: relative; overflow: hidden; }
.menu-card::before { content: ""; width: 46px; height: 5px; border-radius: 999px; background: currentColor; opacity: .5; position: absolute; top: 18px; right: 20px; }
.menu-card::after { content: ""; position: absolute; right: -28px; bottom: -34px; width: 116px; height: 116px; border-radius: 50%; background: currentColor; opacity: .08; }
.menu-card:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -38px rgba(15,36,68,.95); }
.menu-card b { font-size: clamp(22px, 3vw, 28px); line-height: 1.1; }
.menu-card span { color: #64748b; font-size: 15px; font-weight: 700; }
.menu-card.blue { color: #1d5fd1; background: linear-gradient(145deg, #f4f9ff, #e9f3ff); }.menu-card.green { color: #159947; background: linear-gradient(145deg, #f3fff7, #e8fbef); }.menu-card.orange { color: #e96514; background: linear-gradient(145deg, #fff9f1, #fff0df); }.menu-card.purple { color: #6d37d9; background: linear-gradient(145deg, #fbf7ff, #f1eaff); }
.stat-grid { grid-template-columns: repeat(2, 1fr); }
.stat { background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid rgba(215,228,245,.95); border-radius: 20px; padding: 18px; box-shadow: 0 16px 34px -30px rgba(15,36,68,.75), inset 0 1px 0 rgba(255,255,255,.95); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto 16px 0; height: 4px; border-radius: 999px 999px 0 0; background: linear-gradient(90deg, rgba(29,95,209,.78), rgba(20,184,166,.55)); }
.stat span { display: block; color: #64748b; font-size: 14px; font-weight: 800; }
.stat b { display: block; margin-top: 8px; font-size: clamp(28px, 4vw, 36px); line-height: 1; color: var(--blue); }
.input { width: 100%; min-height: 54px; border: 1.6px solid #dbe7f5; border-radius: 17px; padding: 12px 15px; font: inherit; font-weight: 700; background: linear-gradient(180deg, #fff, #fbfdff); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.input:focus { outline: 4px solid rgba(29,95,209,.13); border-color: var(--blue); }
select.input { appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%), linear-gradient(180deg, #fff, #fbfdff); background-position: calc(100% - 23px) 24px, calc(100% - 16px) 24px, 0 0; background-size: 7px 7px, 7px 7px, 100% 100%; background-repeat: no-repeat; }
.date-btn { width: 100%; min-height: 58px; border: 2px solid #dbe7f5; border-radius: 18px; padding: 9px 11px 9px 18px; background: linear-gradient(180deg, #fff, #fbfdff); color: var(--ink); font: inherit; font-weight: 900; display: flex; align-items: center; justify-content: space-between; cursor: pointer; box-shadow: 0 14px 34px -28px rgba(79, 70, 229, .9), inset 0 1px 0 rgba(255,255,255,.95); }
.date-btn:hover, .date-btn:focus { border-color: #7c3aed; outline: 4px solid rgba(124, 58, 237, .12); box-shadow: 0 20px 42px -30px rgba(79, 70, 229, .85), 0 0 0 1px rgba(124,58,237,.08); }
.date-btn b { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #f4efff, #eef6ff); color: #7c3aed; }
.date-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-pop { position: fixed; inset: auto 12px 18px; z-index: 100; background: rgba(255,255,255,.98); border: 1px solid rgba(210, 226, 244, .9); border-radius: 30px; padding: 22px; box-shadow: 0 34px 100px -36px rgba(15,36,68,.85), 0 8px 26px -22px rgba(20,184,166,.7); display: none; backdrop-filter: blur(14px); }
.date-pop.open { display: block; animation: popIn .14s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.date-head { display: grid; grid-template-columns: 44px 1fr 1fr 44px; align-items: center; gap: 9px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid #edf2f7; }
.date-nav, .date-today, .date-clear { border: 0; border-radius: 14px; min-height: 42px; padding: 0 13px; font-weight: 900; cursor: pointer; }
.date-nav { width: 42px; background: transparent; color: #64748b; font-size: 32px; line-height: 1; }
.date-nav:hover { background: #f1f5f9; color: #0f2444; }
.date-select { width: 100%; min-height: 42px; border: 1.6px solid #0f172a; border-radius: 15px; background: #fff; color: #0f172a; font: inherit; font-weight: 900; padding: 0 34px 0 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #334155 50%), linear-gradient(135deg, #334155 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 12px) 18px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.date-select:focus { outline: 3px solid rgba(20,184,166,.14); border-color: #14b8a6; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.date-week { text-align: center; font-size: 13px; color: #94a3b8; font-weight: 900; padding: 8px 0 10px; }
.date-day { border: 0; min-height: 46px; border-radius: 16px; background: transparent; color: #0f172a; font-weight: 950; font-size: 17px; cursor: pointer; }
.date-day:hover { background: #f1f5f9; color: #0f766e; }
.date-day.today { outline: 3px solid #2f9e91; outline-offset: -3px; color: #2f9e91; background: #f8fffd; }
.date-day.selected { background: linear-gradient(135deg, #2f9e91, #14b8a6); color: #fff; box-shadow: 0 14px 26px -18px rgba(20,184,166,.9); outline: 0; }
.date-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf2f7; }
.date-today, .date-clear { background: transparent; flex: 1; }
.date-today { color: #0f766e; text-align: right; }
.date-clear { color: #e11d48; text-align: left; }
label { font-weight: 850; font-size: 14px; display: block; margin-bottom: 7px; color: #334155; }
.field { min-width: 0; }
.field-button { align-self: end; }
.wide { grid-column: 1 / -1; }
.form-grid, .filter-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid.compact { margin-bottom: 16px; }
.inline-form { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.small-input { max-width: 110px; }
.search-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 16px 0; }
.btn { min-height: 52px; border: 0; border-radius: 17px; padding: 12px 22px; font-weight: 900; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; box-shadow: 0 18px 34px -28px rgba(15,36,68,.9); transition: transform .14s ease, box-shadow .14s ease, filter .14s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 24px 44px -30px rgba(15,36,68,.95); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary { background: linear-gradient(135deg, #2b70dd, #164aa9); color: #fff; }
.btn.success { background: linear-gradient(135deg, #22c55e, #159947); color: #fff; }
.btn.light { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.btn.ghost { background: linear-gradient(180deg, #f8fbff, #eef5ff); color: var(--blue); border: 1px solid #d7e4f5; }
.btn.full { width: 100%; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { min-height: 54px; margin: 0; border: 1px solid rgba(215,228,245,.95); border-radius: 17px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(180deg, #fff, #f8fbff); box-shadow: 0 14px 30px -28px rgba(15,36,68,.8); font-size: 15px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 600; margin-left: 4px; }
.file-input { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important; }
.file-drop { min-height: 118px; margin: 0; border: 0; border-radius: 26px; background: radial-gradient(circle at 12% 18%, rgba(255,255,255,.42), transparent 28%), linear-gradient(135deg, #1d5fd1, #0f766e); display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; cursor: pointer; color: #fff; box-shadow: 0 30px 70px -42px rgba(7,29,79,.95), inset 0 1px 0 rgba(255,255,255,.26); transition: transform .16s ease, box-shadow .16s ease, filter .16s ease; position: relative; overflow: hidden; }
.file-drop::after { content: ""; position: absolute; right: -34px; bottom: -42px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.12); }
.file-drop:hover, .file-drop.drag { transform: translateY(-3px); filter: saturate(1.08); box-shadow: 0 36px 84px -44px rgba(7,29,79,1), inset 0 1px 0 rgba(255,255,255,.32); }
.file-drop.has-file { background: radial-gradient(circle at 12% 18%, rgba(255,255,255,.4), transparent 28%), linear-gradient(135deg, #0f766e, #16a34a); }
.file-icon { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; color: #10315f; background: rgba(255,255,255,.92); font-size: 34px; font-weight: 950; box-shadow: 0 20px 34px -26px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.95); position: relative; z-index: 1; }
.file-copy { min-width: 0; position: relative; z-index: 1; }
.file-drop b { display: block; color: #fff; font-size: 21px; line-height: 1.15; }
.file-drop small { display: block; margin-top: 7px; color: rgba(255,255,255,.82); font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-action { position: relative; z-index: 1; border-radius: 18px; padding: 13px 18px; color: #123f92; background: rgba(255,255,255,.94); box-shadow: 0 18px 30px -24px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.95); font-size: 16px; font-weight: 950; white-space: nowrap; }
.file-badge { position: relative; z-index: 1; grid-column: 2 / -1; justify-self: start; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 950; white-space: nowrap; }
.pa-panel, .invoice-panel { background: linear-gradient(180deg, #f8fbff, #fff); border: 1px solid rgba(215,228,245,.95); border-radius: 22px; padding: 16px; box-shadow: 0 16px 36px -32px rgba(15,36,68,.8); }
.pa-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pa-btn { min-height: 56px; border: 2px solid #e2e8f0; border-radius: 17px; background: linear-gradient(180deg, #fff, #f1f5f9); color: #64748b; font-weight: 950; font-size: 16px; cursor: pointer; transition: .15s; box-shadow: 0 14px 30px -28px rgba(15,36,68,.8); }
.pa-btn:not(.on):hover { background: #eaf3ff; color: var(--blue); }
.pa-btn.pa-yes.on { background: linear-gradient(135deg, #16a34a, #15803d); border-color: #16a34a; color: #fff; box-shadow: 0 14px 26px -20px #15803d; }
.pa-btn.pa-no.on { background: linear-gradient(135deg, #7c3aed, #4f46e5); border-color: #7c3aed; color: #fff; box-shadow: 0 14px 26px -20px #4f46e5; }
.pa-number { margin-top: 10px; }
.result-area.empty { color: var(--muted); padding: 30px 20px; text-align: center; font-size: 18px; font-weight: 800; }
.patient-card { background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid rgba(215,228,245,.95); border-radius: 24px; padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.patient-card h3 { margin: 0 0 8px; color: var(--blue); font-size: 24px; }
.summary-row { display: flex; gap: 10px 14px; flex-wrap: wrap; color: #64748b; font-size: 15px; font-weight: 750; }
.summary-row span { background: #f4f8ff; border: 1px solid #e4eefb; border-radius: 999px; padding: 7px 11px; }
.table-wrap { width: 100%; overflow-x: auto; margin-top: 14px; border: 1px solid rgba(215,228,245,.95); border-radius: 22px; background: #fff; box-shadow: 0 18px 40px -34px rgba(15,36,68,.8); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: top; }
th { background: linear-gradient(180deg, #eaf3ff, #dfeeff); color: #24476f; font-size: 14px; white-space: nowrap; font-weight: 950; }
td { font-size: 15px; font-weight: 650; }
tbody tr:hover { background: #f8fbff; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; min-width: 132px; }
.mini-btn { border: 0; border-radius: 13px; min-height: 38px; padding: 9px 12px; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 13px; font-weight: 950; cursor: pointer; box-shadow: 0 14px 28px -24px rgba(15,36,68,.85); }
.mini-btn.edit { background: linear-gradient(135deg, #eaf3ff, #dbeafe); color: #1d5fd1; border: 1px solid #c7dbf7; }
.mini-btn.danger { background: linear-gradient(135deg, #fff1f2, #fee2e2); color: #dc2626; border: 1px solid #fecaca; }
.mini-btn:hover { transform: translateY(-1px); }
.card-list { display: grid; gap: 12px; }
.alert-card { border: 1px solid rgba(253,186,116,.65); border-left: 7px solid var(--orange); background: linear-gradient(135deg, #fffaf4, #fff); border-radius: 20px; padding: 16px; box-shadow: 0 16px 34px -30px rgba(249,115,22,.9); }
.alert-card.expired { border-left-color: var(--red); background: linear-gradient(135deg, #fff1f2, #fff); box-shadow: 0 16px 34px -30px rgba(220,38,38,.9); }
.alert-card b { display: block; margin-bottom: 5px; font-size: 17px; }
.danger { color: var(--red); }
.orange-text { color: var(--orange); }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(145deg, #eaf3ff, #fff 45%, #edf4ff); }
.login-card { width: min(440px, 100%); box-shadow: var(--shadow-strong); }
.login-card h1 { margin: 12px 0 4px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-card label { margin-top: 12px; }
.alert { padding: 14px; border-radius: 16px; background: #fff1f2; margin-bottom: 12px; font-weight: 800; }
.app-modal { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 18px; background: rgba(15, 23, 42, .58); backdrop-filter: blur(9px); }
.app-modal.open { display: grid; animation: fadeIn .14s ease-out; }
.app-modal-card { width: min(430px, 100%); border-radius: 30px; padding: 30px 28px 26px; text-align: center; background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,251,255,.97)); border: 1px solid rgba(255,255,255,.72); box-shadow: 0 34px 110px -42px rgba(7,29,79,.95), inset 0 1px 0 rgba(255,255,255,.95); transform: translateY(6px) scale(.98); animation: modalPop .18s ease-out forwards; }
.app-modal-icon { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 30px; display: grid; place-items: center; font-size: 46px; font-weight: 950; box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 22px 40px -30px rgba(15,36,68,.95); }
.app-modal[data-type="success"] .app-modal-icon { background: linear-gradient(145deg, #dcfce7, #bbf7d0); color: #16a34a; }
.app-modal[data-type="success"] .app-modal-icon::before { content: "✓"; }
.app-modal[data-type="error"] .app-modal-icon { background: linear-gradient(145deg, #fee2e2, #fecaca); color: #dc2626; }
.app-modal[data-type="error"] .app-modal-icon::before { content: "×"; }
.app-modal[data-type="warn"] .app-modal-icon { background: linear-gradient(145deg, #fff7ed, #fed7aa); color: #f97316; }
.app-modal[data-type="warn"] .app-modal-icon::before { content: "!"; }
.app-modal[data-type="info"] .app-modal-icon { background: linear-gradient(145deg, #dbeafe, #bfdbfe); color: #1d5fd1; }
.app-modal[data-type="info"] .app-modal-icon::before { content: "i"; }
.app-modal-card h3 { margin: 0 0 8px; color: var(--ink); font-size: 28px; line-height: 1.15; }
.app-modal-card p { margin: 0; color: #475569; font-size: 17px; font-weight: 750; line-height: 1.5; }
.app-modal-card small { margin-top: 10px; color: #64748b; font-size: 14px; font-weight: 800; }
.app-modal-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
.app-modal-actions .btn { width: 100%; border-radius: 18px; min-height: 56px; font-size: 18px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { to { transform: none; } }
.footer { width: min(1180px, calc(100% - 24px)); margin: -66px auto 22px; background: rgba(255,255,255,.94); border: 1px solid rgba(215,228,245,.95); border-radius: 24px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); box-shadow: 0 20px 44px -34px rgba(15,36,68,.75); backdrop-filter: blur(12px); }
.footer b { color: var(--ink); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 850; }
canvas { width: 100%; background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid rgba(215,228,245,.95); border-radius: 22px; padding: 12px; box-shadow: 0 18px 40px -34px rgba(15,36,68,.8); }
@media (min-width: 760px) {
  .user-chip { display: inline; }
  .container { padding: 20px 20px 100px; }
  .form-grid, .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-grid, .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .chart-grid { grid-template-columns: 1.4fr 1fr; }
  .inline-form { grid-template-columns: 180px 1fr 100px auto; }
  .footer { flex-direction: row; justify-content: space-between; align-items: center; }
  .date-pop { width: 360px; inset: auto auto auto auto; position: absolute; }
}

@media (max-width: 759px) {
  body { background: linear-gradient(180deg, #f8fbff 0, #edf4ff 190px, #f2f7ff 100%); font-size: 15px; }
  .topbar { padding: 12px; gap: 12px; }
  .brand { gap: 10px; }
  .brand-icon, .login-logo { width: 50px; height: 50px; border-radius: 17px; font-size: 24px; }
  .brand h1 { font-size: 20px; }
  .brand p { font-size: 12px; }
  .icon-btn { padding: 9px 11px; border-radius: 13px; }
  .tabs { top: 74px; grid-template-columns: repeat(5, minmax(98px, 1fr)); padding: 10px 10px 12px; gap: 8px; scroll-snap-type: x proximity; }
  .tabs a { min-height: 58px; border-radius: 18px; font-size: 18px; scroll-snap-align: start; }
  .tabs span { font-size: 12px; }
  .container { padding: 18px 12px 104px; }
  .hero { align-items: stretch; flex-direction: column; border-radius: 24px; }
  .hero .btn { width: 100%; }
  .panel, .hero, .login-card { border-radius: 24px; padding: 18px; }
  .panel h2 { font-size: 28px; }
  .menu-grid { gap: 10px; }
  .menu-card { min-height: 124px; padding: 18px; border-radius: 22px; }
  .menu-card::before { top: 14px; right: 16px; width: 36px; }
  .menu-card b { font-size: 21px; }
  .menu-card span { font-size: 13px; }
  .stat-grid { gap: 10px; }
  .stat { padding: 15px; border-radius: 18px; }
  .stat b { font-size: 30px; }
  .search-box { grid-template-columns: 1fr; }
  .btn { width: 100%; min-height: 54px; }
  .actions .btn { flex: 1 1 160px; }
  .date-pop { left: 10px; right: 10px; bottom: 12px; padding: 18px; border-radius: 28px; }
  .date-head { grid-template-columns: 38px minmax(0, 1.35fr) minmax(0, .95fr) 38px; gap: 7px; }
  .date-nav { width: 38px; min-height: 38px; font-size: 28px; }
  .date-select { min-height: 39px; border-radius: 14px; font-size: 14px; padding-left: 10px; }
  .date-grid { gap: 7px; }
  .date-day { min-height: 42px; border-radius: 14px; font-size: 16px; }
  .file-drop { grid-template-columns: 52px minmax(0, 1fr); min-height: 112px; padding: 18px; }
  .file-icon { width: 52px; height: 52px; border-radius: 18px; font-size: 30px; }
  .file-action { grid-column: 1 / -1; justify-self: stretch; text-align: center; padding: 12px 16px; }
  .file-badge { grid-column: 1 / -1; justify-self: start; align-self: auto; }
  .table-wrap { border-radius: 18px; }
  th, td { padding: 12px 10px; }
  .footer { margin: -78px 12px 18px; width: calc(100% - 24px); border-radius: 22px; padding: 14px 16px; }
}

@media (max-width: 430px) {
  .brand h1 { font-size: 18px; }
  .brand p { display: none; }
  .tabs { grid-template-columns: repeat(5, 92px); }
  .tabs a { min-height: 54px; font-size: 17px; }
  .menu-grid, .stat-grid { grid-template-columns: 1fr; }
  .filter-grid, .form-grid { gap: 12px; }
  .date-btn, .input { min-height: 52px; }
  .footer-links { gap: 10px 12px; }
}
