/* Shared Milara Time Tracking design system. */

:root {
  --bg: #e8edf3;
  --bg-subtle: #f4f7fa;
  --panel: #ffffff;
  --panel-wash: #fbfcfd;
  --text: #162231;
  --muted: #5f6f85;
  --muted-strong: #435269;
  --line: #dce3eb;
  --line-strong: #c7d1de;
  --brand: #43b985;
  --brand-hover: #3aa876;
  --brand-dark: #217554;
  --brand-soft: #e9f7f1;
  --brand-surface: #f4fbf7;
  --nav: #212529;
  --nav-hover: #2a3140;
  --danger: #dc3545;
  --danger-dark: #b42318;
  --warning: #b7791f;
  --warning-soft: #fff8e6;
  --success: #157347;
  --info: #0f5f87;
  --info-soft: #edfaff;
  --shadow-xs: 0 1px 1px rgba(16, 24, 40, .04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 1px rgba(16, 24, 40, .04);
  --shadow: 0 8px 18px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, .16);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --focus-ring: 0 0 0 3px rgba(67, 185, 133, .2);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f3f6f9 0, var(--bg) 260px, var(--bg) 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(67, 185, 133, .22);
}

a {
  color: var(--brand-hover);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
}

.topbar-inner {
  width: 100%;
  max-width: 1360px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 700;
}

.brand:hover {
  color: #fff;
  text-decoration: none;
}

.brand img,
.login-brand img {
  width: 120px;
  height: 38px;
  object-fit: contain;
  filter: brightness(1.08);
}

.brand-product {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .22);
  color: #f8f9fa;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span[aria-hidden="true"] {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(255, 255, 255, .1);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link,
.nav-logout {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.nav-link:hover,
.nav-logout:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
}

.nav-link.is-active {
  background: rgba(67, 185, 133, .2);
  color: #63dba4;
}

.nav-user {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-chip {
  display: inline-flex;
  min-height: 40px;
  padding: 6px 10px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 6px;
  color: #fff;
  line-height: 1.15;
}

.account-chip:hover,
.account-chip.is-active {
  background: rgba(67, 185, 133, .14);
  border-color: rgba(67, 185, 133, .44);
  color: #fff;
  text-decoration: none;
}

.account-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.account-role {
  margin-top: 2px;
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
}

.page {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 24px 42px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  padding: 24px 24px;
  background: linear-gradient(180deg, #fff 0%, var(--panel-wash) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
}

.page-header.admin-hero {
  align-items: center;
  padding: 28px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(135deg, #276f57 0%, var(--brand) 100%);
  border: 0;
}

.page-header.admin-hero::before {
  display: none;
}

.page-header.admin-hero .muted {
  color: rgba(255, 255, 255, .86);
}

.page-header.admin-hero .btn {
  border-color: rgba(255, 255, 255, .78);
  background: #fff;
  color: #217554;
}

.page-header.admin-hero .btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, .92);
}

h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  background: linear-gradient(180deg, #fff 0%, var(--panel-wash) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  font-size: 16px;
}

.panel-header h2,
.panel-header p {
  margin-bottom: 0;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.narrow-panel {
  max-width: 560px;
}

.stack {
  display: grid;
  gap: 14px;
}

.help-text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--muted-strong);
  font-size: 12.5px;
}

.label-hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background-color: #eef2f6;
  color: #5f6f85;
  cursor: not-allowed;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .12);
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-hover) 100%);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:hover {
  border-color: var(--brand-hover);
  background: linear-gradient(180deg, #48c28c 0%, var(--brand-hover) 100%);
  color: #fff;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  border-color: var(--line-strong);
  background: #eef2f6;
  color: #7a8798;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: #344054;
}

.btn.secondary:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: #217554;
}

.btn.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.btn.danger:hover {
  border-color: var(--danger-dark);
  background: var(--danger-dark);
}

.btn.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f1f4f8;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

tbody tr:nth-child(even) td {
  background: #fcfdff;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: var(--brand-surface);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(67, 185, 133, .18) 0%, rgba(67, 185, 133, 0) 42%),
    linear-gradient(180deg, #1f2429 0%, #151a1f 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-lg);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .36);
}

.login-card h1 {
  font-size: 22px;
}

.login-card .muted {
  margin-bottom: 16px;
}

.login-card .grid {
  gap: 14px;
}

.login-card .btn {
  min-height: 42px;
  font-size: 14px;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-strong);
  font-weight: 700;
}

.inline-form {
  display: inline;
}
