:root{
  --navy:#124a7c; --navy-dark:#0f3f6b; --blue:#2a7bc4; --link:#0f4c92;
  --bg:#f3f6fb; --card:#fff; --ink:#14213d; --muted:#6b7a90; --line:#edf0f5;
  --green:#22a96b; --red:#e85d6a; --amber:#f0a03a; --sky:#2b86e0;
  --teal:#0a7f9c;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--bg)}
a{text-decoration:none;color:inherit}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

/* ---------- Login ---------- */
.login-page{min-height:100vh;display:grid;place-items:center;background:#e9f4f7;padding:20px}
.login-card{background:#fff;width:100%;max-width:450px;padding:68px 44px 44px;border-radius:14px;box-shadow:0 10px 30px rgba(10,60,80,.1);text-align:center}
.login-card h1{font-size:30px;color:var(--teal);margin-bottom:20px}
.login-sub{color:#666;font-size:18px;margin-bottom:28px}
.login-card form{display:flex;flex-direction:column;gap:24px}
.login-card input{height:52px;padding:0 16px;border:1px solid #cfd6dc;border-radius:8px;font-size:16px}
.login-card input:focus{border-color:var(--teal);outline:none}
.login-card button{height:54px;margin-top:-6px;border:0;border-radius:8px;background:var(--teal);color:#fff;font-size:20px;cursor:pointer}
.login-card button:hover{background:#086a84}
.login-error{color:#c0392b;font-size:14px;margin-top:-10px}

/* ---------- Layout ---------- */
.app{display:flex;min-height:100vh}
.sidebar{width:274px;flex:none;background:var(--navy);color:#fff;position:sticky;top:0;height:100vh;overflow-y:auto;padding-bottom:24px}
.brand{display:flex;align-items:center;gap:16px;padding:36px 20px 24px;margin:0 12px;border-bottom:1px solid rgba(255,255,255,.12)}
.brand strong{display:block;font-size:26px;letter-spacing:1.5px}
.brand small{font-size:14px;opacity:.9}
.drop{width:26px;height:34px;background:linear-gradient(160deg,#b8d9ff,#5aa6f0);border-radius:50% 50% 50% 50%/62% 62% 38% 38%;transform:rotate(0deg);flex:none}
.nav-title{font-size:13px;font-weight:700;letter-spacing:1.5px;color:#c6d6e8;padding:30px 12px 8px 24px}
.nav-item{display:flex;align-items:center;gap:14px;margin:0 12px;padding:16px 12px;border-radius:8px;font-size:18px;cursor:pointer;color:#fff}
.nav-item:hover{background:rgba(255,255,255,.08)}
.nav-item.active{background:var(--blue)}
.nav-item .ico{width:20px;text-align:center;font-size:15px}

.content{flex:1;min-width:0;padding:30px 28px 24px}
.menu-btn{display:none;margin-bottom:12px;background:var(--navy);color:#fff;border:0;border-radius:6px;padding:8px 14px;font-size:18px;cursor:pointer}
.card{background:var(--card);border-radius:14px;box-shadow:0 1px 3px rgba(20,33,61,.06);padding:24px 28px}
.card h3{font-size:19px;margin-bottom:6px}
.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}
.card-head h3{margin:0}
.link{color:var(--link);font-weight:600;font-size:15px}
.muted{color:var(--muted)}.small{font-size:14px}

.welcome{display:flex;align-items:center;gap:20px;padding:24px 30px}
.avatar{width:56px;height:56px;border-radius:50%;background:#1565b8;color:#fff;display:grid;place-items:center;font-size:26px;font-weight:700}
.welcome-text{flex:1}
.welcome h1{font-size:28px}
.welcome p{color:var(--muted);font-size:18px}
.welcome time{font-weight:600;color:#3d4b63}
.page-title{font-size:26px;margin:28px 0 4px}
.muted+.stats{margin-top:20px}

/* ---------- Stats ---------- */
.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;margin:20px 0 26px}
.stat{display:flex;align-items:center;gap:16px;background:#fff;border-radius:12px;padding:22px 20px;box-shadow:0 1px 3px rgba(20,33,61,.06);transition:box-shadow .2s}
.stat:hover{box-shadow:0 6px 16px rgba(20,33,61,.12)}
.stat .ico{width:58px;height:58px;border-radius:12px;display:grid;place-items:center;font-size:22px;flex:none}
.stat strong{display:block;font-size:30px;line-height:1.1}
.stat span{color:var(--muted)}
.i-blue{background:#e0eefc;color:#2b7bd0}.i-amber{background:#fdf0d4;color:#c9821a}
.i-red{background:#fde3e5;color:#d93f4e}.i-green{background:#dcf5e9;color:#1d9a62}.i-purple{background:#ece5fb;color:#7a4fd6}

/* ---------- Grid ---------- */
.grid{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(0,1fr);gap:24px;align-items:start}
.col{display:flex;flex-direction:column;gap:24px}
.reminder{background:linear-gradient(135deg,#dcecfb,#e9f3fd);border:1px solid #b9d7f3;border-radius:14px;padding:26px 28px;position:relative}
.reminder h3{color:#10427a;font-size:22px;margin-bottom:16px}
.reminder p{margin-bottom:10px;font-size:16px}
.reminder .drop{position:absolute;right:42px;top:50%;width:34px;height:46px}
.reminder .btn{display:inline-block;margin-top:14px;background:var(--link);color:#fff;padding:11px 18px;border-radius:6px;font-size:15px;transition:background .2s}
.reminder .btn:hover{background:#0b3a74}
.reminder.empty{background:#eaf7f0;border-color:#bfe6d1}
.reminder.empty h3{color:#17724a}

table{width:100%;border-collapse:collapse;font-size:15px}
thead th{background:#f6f8fc;text-align:left;padding:13px 15px;font-size:14px;color:#3d4b63}
tbody td{padding:16px 15px;border-bottom:1px solid var(--line);color:#46556c}
tbody tr:last-child td{border-bottom:0}
tbody td:first-child{font-weight:600;color:var(--ink)}
.empty-row td{text-align:center;color:var(--muted);padding:22px}

.badge{display:inline-block;padding:5px 12px;border-radius:999px;font-size:13px;font-weight:600}
.b-upcoming{background:#dcebfb;color:#1a5fa8}
.b-overdue{background:#fff;color:#10427a}
.b-today{background:#fdf0d4;color:#9a6208}
.b-completed{background:#dcf5e9;color:#17724a}

.bar-row{margin-top:16px}
.bar-label{display:flex;justify-content:space-between;color:#56657c;margin-bottom:8px}
.bar-label b{color:var(--ink)}
.bar{height:11px;border-radius:99px;background:#eceff4;overflow:hidden}
.bar span{display:block;height:100%;border-radius:99px;background:var(--green);transition:width .6s ease}

.donut-wrap{display:flex;align-items:center;gap:32px;padding:30px 0 10px;flex-wrap:wrap;justify-content:center}
.donut{width:188px;height:188px;border-radius:50%;display:grid;place-items:center;background:#eceff4}
.donut-hole{width:116px;height:116px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center}
.donut-hole strong{font-size:28px;line-height:1}
.donut-hole span{font-size:13px;color:var(--muted);margin-top:4px}
.legend{list-style:none;display:flex;flex-direction:column;gap:12px}
.legend li{display:flex;align-items:center;gap:10px;color:#56657c}
.legend i{width:12px;height:12px;border-radius:50%}
.legend b{margin-left:4px;color:var(--ink)}

.recent{margin-top:24px}
.recent ul{list-style:none}
.recent li{display:flex;align-items:center;gap:16px;padding:20px 0;border-bottom:1px solid var(--line)}
.recent li:last-child{border-bottom:0}
.recent .ico{width:44px;height:44px;border-radius:10px;background:#eef2fb;display:grid;place-items:center;flex:none}
.recent .info{flex:1}
.recent .info b{display:block;margin-bottom:4px}
.recent .info span,.recent time{color:var(--muted);font-size:14px}

footer{text-align:center;color:#9aa5b6;font-size:14px;margin-top:38px;line-height:2}

.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--ink);color:#fff;padding:12px 20px;border-radius:8px;font-size:15px;z-index:20}

/* ---------- Responsive ---------- */
@media(max-width:1200px){.stats{grid-template-columns:repeat(3,1fr)}.grid{grid-template-columns:1fr}}
@media(max-width:820px){
  .sidebar{position:fixed;left:0;top:0;z-index:10;transform:translateX(-100%);transition:transform .25s}
  .sidebar.open{transform:none}
  .menu-btn{display:block}
  .stats{grid-template-columns:repeat(2,1fr)}
  .welcome{flex-wrap:wrap}
  .card{overflow-x:auto}
}
@media(max-width:520px){.stats{grid-template-columns:1fr}.content{padding:16px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
