@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #202b3c;
  --muted: #687487;
  --line: #e2e7ee;
  --primary: #193454;
  --primary-dark: #10243d;
  --primary-soft: #edf2f7;
  --accent: #c5a467;
  --wash: #f4f6f9;
  --surface: #fff;
  --shadow-sm: 0 4px 16px rgb(25 42 63 / 5%);
  --shadow-md: 0 14px 36px rgb(25 42 63 / 11%);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--wash); }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 88% 0%, #eaf0f6, transparent 34rem), var(--wash);
  font-family: "DM Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
small { font-size: 13px; }

.sidebar {
  position: fixed; z-index: 20; inset: 0 auto 0 0; width: 264px;
  display: flex; flex-direction: column; padding: 27px 17px 19px;
  color: #fff; background: linear-gradient(165deg, #1d3553, #142943 58%, #102139);
  border-right: 1px solid rgb(255 255 255 / 8%); box-shadow: 8px 0 30px rgb(17 35 57 / 8%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px; color: #fff; text-decoration: none; font-size: 17px; font-weight: 650; }
.brand:hover { color: #fff; }
.brand small { display: block; margin-top: 3px; color: #b5c1ce; font-size: 11px; font-weight: 650; letter-spacing: 1.4px; }
.brand-mark { display: inline-flex; flex: 0 0 43px; align-items: center; justify-content: center; width: 43px; height: 43px; border: 1px solid rgb(255 255 255 / 25%); border-radius: 13px; background: linear-gradient(145deg, #dec38c, #b69153); color: #1b304a; font-weight: 800; letter-spacing: -.5px; box-shadow: 0 6px 18px rgb(8 23 41 / 25%), inset 0 1px rgb(255 255 255 / 38%); }
.sidebar nav { display: grid; gap: 8px; margin-top: 42px; }
.sidebar nav::before { content: "WORKSPACE"; margin: 0 12px 8px; color: #a2afbd; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; }
.sidebar nav a, .logout-form button {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 49px; padding: 13px 14px; border: 1px solid transparent; border-radius: 10px;
  color: #d1d9e2; text-decoration: none; font-size: 15px; font-weight: 600;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.sidebar nav a:hover, .logout-form button:hover { transform: translateX(2px); border-color: rgb(255 255 255 / 8%); background: rgb(255 255 255 / 7%); color: #fff; }
.sidebar nav a.active { border-color: rgb(197 164 103 / 24%); background: linear-gradient(100deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 5%)); color: #fff; box-shadow: inset 3px 0 var(--accent); }
.logout-form { margin-top: auto; }
.logout-form button { width: 100%; border: 0; background: transparent; text-align: left; }

.main-content { min-height: 100vh; margin-left: 264px; }
.topbar {
  position: sticky; z-index: 10; top: 0; min-height: 82px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 40px; border-bottom: 1px solid rgb(226 231 238 / 90%);
  background: rgb(255 255 255 / 91%); backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; color: var(--ink); font-size: 27px; font-weight: 700; letter-spacing: -.45px; line-height: 1.25; }
.topbar small { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .5px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.profile-menu { position: relative; }
.profile-menu summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; color: #29384b; font-size: 14px; font-weight: 650; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary::after { content: ""; width: 7px; height: 7px; margin: -4px 2px 0 3px; border-right: 1.5px solid #728096; border-bottom: 1.5px solid #728096; transform: rotate(45deg); }
.avatar { display: grid; place-items: center; width: 39px; height: 39px; border: 2px solid white; border-radius: 12px; background: #e7edf4; color: var(--primary); font-size: 12px; font-weight: 750; box-shadow: 0 0 0 1px #dce3eb; }
.profile-dropdown { position: absolute; z-index: 30; top: calc(100% + 12px); right: 0; min-width: 215px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); }
.profile-dropdown a, .profile-dropdown button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: #fff; color: var(--ink); text-align: left; text-decoration: none; font: inherit; font-size: 14px; }
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--primary-soft); color: var(--primary-dark); }

.page-body { max-width: 1660px; margin: 0 auto; padding: 31px 40px 50px; }
.welcome {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 156px; margin-bottom: 22px; padding: 30px 34px; border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 17px; background: radial-gradient(ellipse at 86% 15%, rgb(197 164 103 / 25%), transparent 35%), linear-gradient(112deg, #142943, #1e3c5b 64%, #344c68);
  color: white; box-shadow: 0 13px 32px rgb(25 42 63 / 18%);
}
.welcome::after { content: ""; position: absolute; right: 18%; bottom: -92px; width: 230px; height: 230px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 50%; box-shadow: 0 0 0 28px rgb(255 255 255 / 4%), 0 0 0 58px rgb(255 255 255 / 3%); pointer-events: none; }
.welcome > * { position: relative; z-index: 1; }
.welcome h2 { margin: 0 0 7px; color: white; font-size: clamp(23px, 2vw, 29px); font-weight: 700; letter-spacing: -.4px; }
.welcome p { margin: 0; color: rgb(255 255 255 / 77%); font-size: 15px; }
.welcome .btn { border-color: #e2d3b6; background: #fff; color: var(--primary); box-shadow: 0 5px 15px rgb(10 24 41 / 17%); }
.welcome .btn:hover { background: #f5f1e8; }

.panel, .stat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel { padding: 22px 23px; }
.panel h2.h5 { font-size: 21px; }
.panel h3, .panel h2.h6 { font-size: 18px; }
.stat-card { position: relative; overflow: hidden; height: 100%; min-height: 120px; padding: 19px 20px; transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after { content: ""; position: absolute; right: -25px; bottom: -40px; width: 100px; height: 100px; border-radius: 50%; background: #edf2f7; }
.stat-card span, .stat-card strong { position: relative; z-index: 1; display: block; }
.stat-card span { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat-card strong { margin-top: 11px; color: var(--ink); font-size: 32px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.stat-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgb(25 52 84 / 10%); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.panel-heading h3 { margin: 0 0 5px; color: var(--ink); font-size: 18px; font-weight: 700; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.panel-heading a { color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 650; }
.panel-heading a:hover { color: var(--primary-dark); text-decoration: underline; }

.table-responsive { border-radius: 10px; }
.table { margin-bottom: 0; color: #3b4655; font-size: 14px; --bs-table-bg: transparent; --bs-table-color: #3b4655; --bs-table-border-color: #edf0f4; }
.table thead th { padding: 13px; border-bottom: 1px solid var(--line); background: #f6f8fa; color: #687487; font-size: 11px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; white-space: nowrap; }
.table thead th:first-child { border-radius: 8px 0 0 8px; }
.table thead th:last-child { border-radius: 0 8px 8px 0; }
.table td { padding: 14px 13px; border-color: #edf0f4; vertical-align: middle; }
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { --bs-table-bg: #f8fafc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td small.text-secondary { color: #778397 !important; font-size: 12px; font-weight: 650; }
.table td a.fw-semibold { color: #213b58; font-size: 14px; font-weight: 650 !important; text-decoration: none; }
.table td a.fw-semibold:hover { color: #8f713d; text-decoration: underline; }
.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #d7e0eb; border-radius: 999px; background: #edf2f7; color: #294b70; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-status.completed { border-color: #cfe3d6; background: #edf6f0; color: #34734a; }
.badge-status.waiting { border-color: #eadbbd; background: #f8f2e7; color: #896628; }
.badge-status.overdue { border-color: #edcfca; background: #fbefed; color: #a84d43; }

.btn, button { font-family: "DM Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif; font-weight: 650; }
.btn { border-radius: 9px; font-size: 16px; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.btn-sm { font-size: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgb(25 52 84 / 16%); }
.btn-primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); color: #fff; }
.btn-outline-primary { border-color: #b9c5d3; color: var(--primary); }
.btn-outline-primary:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-outline-secondary { border-color: #ccd3dc; color: #536174; }
.btn-outline-secondary:hover { border-color: #d5c39e; background: #f4f0e7; color: #574a32; }
.btn-primary:active, .btn-primary.active, .show > .btn-primary.dropdown-toggle { border-color: #10243d !important; background: #10243d !important; color: #fff !important; }
.btn-outline-primary:active, .btn-outline-primary.active { border-color: #10243d !important; background: #10243d !important; color: #fff !important; }
.btn-primary, .btn-outline-primary, .btn-outline-secondary { --bs-btn-focus-shadow-rgb: 197, 164, 103; }
.btn:focus, .btn:focus-visible, .btn:active:focus, .btn-check:focus + .btn, button:focus-visible { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgb(197 164 103 / 34%) !important; }

.form-label { margin-bottom: 7px; color: #39485b; font-size: 14px; font-weight: 650; }
.form-control, .form-select { min-height: 42px; border-color: #d8dfe7; border-radius: 8px; background-color: #fff; color: #27384c; font-size: 14px; box-shadow: none; }
textarea.form-control { min-height: initial; }
.form-control::placeholder { color: #8994a3; }
.form-control:focus, .form-select:focus { border-color: #a8b5c4; box-shadow: 0 0 0 3px rgb(25 52 84 / 10%); }
.form-check-input:checked { border-color: var(--primary); background-color: var(--primary); }
.form-text, .small { color: var(--muted); font-size: 13px !important; }
.list-group-item { border-color: #e8ecf1; font-size: 14px; }
.list-group-item-action:hover { background: #f5f7fa; }
.alert { border: 0; border-radius: 9px; font-size: 14px; }
.text-secondary { color: var(--muted) !important; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 18% 20%, #eaf0f6, transparent 36rem), radial-gradient(ellipse at 90% 90%, #e9edf2, transparent 32rem), #f4f6f9; }
.login-card { width: min(430px, calc(100% - 32px)); padding: 38px; border: 1px solid #fff; border-radius: 18px; background: #fff; box-shadow: 0 20px 60px rgb(25 42 63 / 12%); }
.login-card h1 { margin: 23px 0 6px; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -.45px; }
.login-card p { margin-bottom: 25px; color: var(--muted); font-size: 15px; }
.login-card .form-control, .login-card .btn { min-height: 46px; }
.login-card .brand-mark { width: 48px; height: 48px; }

@media (max-width: 1000px) {
  .sidebar { width: 238px; }
  .main-content { margin-left: 238px; }
  .topbar { padding-right: 26px; padding-left: 26px; }
  .page-body { padding-right: 26px; padding-left: 26px; }
}
@media (max-width: 760px) {
  .sidebar { inset: auto 0 0; width: 100%; height: 66px; padding: 5px 7px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid rgb(255 255 255 / 12%); border-right: 0; background: #142943; }
  .brand, .logout-form, .sidebar nav::before { display: none; }
  .sidebar nav { display: flex; justify-content: space-around; gap: 2px; width: 100%; margin: 0; }
  .sidebar nav a { justify-content: center; flex: 1; min-width: 0; min-height: 46px; padding: 10px 3px; font-size: 12px; text-align: center; }
  .sidebar nav a.active { box-shadow: inset 0 2px var(--accent); }
  .main-content { margin-left: 0; padding-bottom: 72px; }
  .topbar { min-height: 70px; padding: 12px 16px; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions { gap: 8px; }
  .topbar-actions #profile-name, .profile-menu summary::after { display: none; }
  .page-body { padding: 20px 14px 34px; }
  .welcome { min-height: 0; align-items: flex-start; flex-direction: column; padding: 24px; }
  .welcome::after { right: -15%; }
  .panel { padding: 17px 15px; }
  .panel-heading { flex-direction: column; }
  .btn { font-size: 15px; }
  .btn-sm { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Lighter professional finish: white surfaces, slate blue and a restrained brass accent. */
:root {
  --ink: #263648;
  --muted: #68788a;
  --line: #e1e7ed;
  --primary: #426784;
  --primary-dark: #34546f;
  --primary-soft: #edf3f7;
  --accent: #b89a5b;
  --wash: #f5f7f9;
  --surface: #fff;
  --shadow-sm: 0 3px 14px rgb(38 54 72 / 5%);
  --shadow-md: 0 12px 30px rgb(38 54 72 / 10%);
}
body { background: #f5f7f9; color: var(--ink); }
.sidebar { color: var(--ink); background: #fff; border-right-color: #e4e9ef; box-shadow: 4px 0 18px rgb(38 54 72 / 4%); }
.brand, .brand:hover { color: #263648; }
.brand small { color: #8793a0; }
.brand-mark { border-color: #dce5ed; background: linear-gradient(145deg,#7391aa,#426784); color: #fff; box-shadow: 0 5px 13px rgb(66 103 132 / 18%); }
.sidebar nav::before { color: #8a96a3; }
.sidebar nav a, .logout-form button { color: #5c6d7e; }
.sidebar nav a:hover, .logout-form button:hover { border-color: #e8edf2; background: #f7f9fb; color: #263648; }
.sidebar nav a.active { border-color: #e2eaf0; background: #edf3f7; color: #34546f; box-shadow: inset 3px 0 #6e8ca4; }
.topbar { border-bottom-color: #e3e8ee; background: rgb(255 255 255 / 94%); }
.topbar h1 { color: #263648; }
.topbar small { color: #718296; }
.avatar { border-color: #fff; background: #e9f0f5; color: #426784; box-shadow: 0 0 0 1px #dce5ed; }
.welcome { border-color: #dfe8ef; background: radial-gradient(ellipse at 87% 15%,rgb(255 255 255 / 92%),transparent 36%),linear-gradient(110deg,#e8eff5,#f0f4f7 58%,#e6edf2); color: #263648; box-shadow: 0 8px 24px rgb(38 54 72 / 7%); }
.welcome::after { border-color: rgb(66 103 132 / 12%); box-shadow: 0 0 0 28px rgb(66 103 132 / 3%),0 0 0 58px rgb(66 103 132 / 2%); }
.welcome h2 { color: #263648; }
.welcome p { color: #68788a; }
.welcome .btn { border-color: #426784; background: #426784; color: #fff; box-shadow: 0 4px 10px rgb(66 103 132 / 15%); }
.welcome .btn:hover { border-color: #34546f; background: #34546f; color: #fff; }
.panel, .stat-card { border-color: #e1e7ed; background: #fff; }
.stat-card::after { background: #f0f4f7; }
.table { --bs-table-border-color: #edf0f3; color: #3b4b5c; --bs-table-color: #3b4b5c; }
.table thead th { border-color: #e3e8ee; background: #f7f9fb; color: #718092; }
.table tbody tr:hover { --bs-table-bg: #f8fafb; }
.table td a.fw-semibold { color: #355b79; }
.badge-status { border-color: #dbe5ed; background: #eff4f7; color: #426784; }
.btn-primary { border-color: #426784; background: #426784; box-shadow: 0 3px 9px rgb(66 103 132 / 15%); }
.btn-primary:hover { border-color: #34546f; background: #34546f; }
.btn-primary:active, .btn-primary.active, .show > .btn-primary.dropdown-toggle { border-color: #34546f !important; background: #34546f !important; }
.btn-outline-primary { border-color: #b8c8d5; color: #426784; }
.btn-outline-primary:hover, .btn-outline-primary:active, .btn-outline-primary.active { border-color: #426784 !important; background: #426784 !important; color: #fff !important; }
.form-control, .form-select { border-color: #d9e1e8; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: #91a7b9; box-shadow: 0 0 0 3px rgb(66 103 132 / 11%); }
.form-check-input:checked { border-color: #426784; background-color: #426784; }
.login-page { background: radial-gradient(ellipse at 15% 15%,#e9f0f5,transparent 36rem),#f5f7f9; }
.login-card { border-color: #e6ebf0; background: #fff; box-shadow: 0 18px 52px rgb(38 54 72 / 9%); }
@media(max-width:760px) {
  .sidebar { background: #fff; border-top-color: #e1e7ed; }
  .sidebar nav a { color: #5c6d7e; }
  .sidebar nav a.active { box-shadow: inset 0 2px #6e8ca4; }
}
