/* OpenRMA Material Design 3 inspired theme */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  --md-sys-color-primary: #1a73e8;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d2e3fc;
  --md-sys-color-on-primary-container: #041e49;
  --md-sys-color-secondary: #5f6368;
  --md-sys-color-surface: #f8f9fa;
  --md-sys-color-surface-container: #ffffff;
  --md-sys-color-surface-container-high: #f1f3f4;
  --md-sys-color-outline: #dadce0;
  --md-sys-color-outline-variant: #e8eaed;
  --md-sys-color-on-surface: #202124;
  --md-sys-color-on-surface-variant: #5f6368;
  --md-sys-color-error: #d93025;
  --md-sys-color-success: #1e8e3e;
  --md-sys-color-warning: #f9ab00;
  --md-elevation-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --md-elevation-2: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
  --md-elevation-3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  --md-radius: 12px;
  --md-radius-sm: 8px;
  --sidebar-w: 280px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Roboto', system-ui, sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--md-sys-color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.md-app { display: flex; min-height: 100vh; }
.md-sidebar {
  width: var(--sidebar-w);
  background: var(--md-sys-color-surface-container);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.md-sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; font-size: 1.25rem; font-weight: 500; color: var(--md-sys-color-primary);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.md-sidebar-brand .logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--md-sys-color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.md-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.md-nav-group { margin-bottom: 4px; }
.md-nav-group-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-radius: 24px; cursor: pointer;
  font-weight: 500; font-size: .9rem; color: var(--md-sys-color-on-surface);
  user-select: none;
}
.md-nav-group-title:hover { background: var(--md-sys-color-surface-container-high); }
.md-nav-group-title .chevron { font-size: .7rem; opacity: .6; transition: transform .2s; }
.md-nav-group.open .md-nav-group-title .chevron { transform: rotate(90deg); }
.md-nav-children { display: none; padding: 0 0 4px 8px; }
.md-nav-group.open .md-nav-children { display: block; }
.md-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 20px; border-radius: 24px;
  color: var(--md-sys-color-on-surface-variant); font-size: .875rem;
  text-decoration: none !important;
}
.md-nav-item:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.md-nav-item.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 500;
}
.md-nav-item .mi { font-size: 1.15rem; width: 24px; text-align: center; opacity: .9; }

.md-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.md-topbar {
  height: var(--topbar-h); background: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
  box-shadow: var(--md-elevation-1);
}
.md-topbar h1 { font-size: 1.15rem; font-weight: 500; }
.md-content { padding: 24px; flex: 1; max-width: 1400px; }

/* Cards */
.md-card {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-radius);
  box-shadow: var(--md-elevation-1);
  padding: 20px;
  border: 1px solid var(--md-sys-color-outline-variant);
}
.md-card-title { font-size: 1rem; font-weight: 500; margin-bottom: 12px; }

/* Stats */
.md-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1100px) { .md-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .md-stats { grid-template-columns: 1fr; } }
.md-stat {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-radius); padding: 20px;
  box-shadow: var(--md-elevation-1); border: 1px solid var(--md-sys-color-outline-variant);
}
.md-stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--md-sys-color-on-surface-variant); font-weight: 500; }
.md-stat-value { font-size: 1.75rem; font-weight: 500; margin-top: 4px; color: var(--md-sys-color-on-surface); }
.md-stat-meta { font-size: .8rem; color: var(--md-sys-color-success); margin-top: 4px; }

/* Buttons — Material */
.md-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: 20px; border: none;
  font-family: inherit; font-size: .875rem; font-weight: 500;
  cursor: pointer; text-decoration: none !important;
  transition: box-shadow .2s, background .2s;
}
.md-btn:disabled { opacity: .5; cursor: not-allowed; }
.md-btn-filled {
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-elevation-1);
}
.md-btn-filled:hover { box-shadow: var(--md-elevation-2); filter: brightness(1.05); color: #fff; }
.md-btn-outlined {
  background: transparent; color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}
.md-btn-outlined:hover { background: rgba(26,115,232,.08); color: var(--md-sys-color-primary); }
.md-btn-text { background: transparent; color: var(--md-sys-color-primary); padding: 0 12px; }
.md-btn-text:hover { background: rgba(26,115,232,.08); }
.md-btn-tonal {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.md-btn-sm { height: 32px; padding: 0 16px; font-size: .8rem; border-radius: 16px; }
.md-btn-danger { background: var(--md-sys-color-error); color: #fff; }

/* Forms */
.md-field { margin-bottom: 16px; }
.md-field label {
  display: block; font-size: .75rem; font-weight: 500;
  color: var(--md-sys-color-on-surface-variant); margin-bottom: 6px;
}
.md-field input, .md-field select, .md-field textarea {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 4px; background: var(--md-sys-color-surface-container);
  font-family: inherit; font-size: 1rem; color: var(--md-sys-color-on-surface);
  transition: border-color .15s, box-shadow .15s;
}
.md-field textarea { height: auto; padding: 12px 16px; min-height: 96px; }
.md-field input:focus, .md-field select:focus, .md-field textarea:focus {
  outline: none; border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}
.md-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .md-field-row { grid-template-columns: 1fr; } }

/* Tables */
.md-table-wrap { overflow-x: auto; }
.md-table { width: 100%; border-collapse: collapse; }
.md-table th {
  text-align: left; padding: 12px 16px; font-size: .75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--md-sys-color-on-surface-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.md-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font-size: .875rem;
}
.md-table tr:hover td { background: var(--md-sys-color-surface-container-high); }

/* Chips / badges */
.md-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 8px; font-size: .75rem; font-weight: 500;
}
.md-chip-blue { background: #e8f0fe; color: #1967d2; }
.md-chip-green { background: #e6f4ea; color: #137333; }
.md-chip-amber { background: #fef7e0; color: #b06000; }
.md-chip-red { background: #fce8e6; color: #c5221f; }
.md-chip-purple { background: #f3e8fd; color: #7627bb; }
.md-chip-grey { background: #f1f3f4; color: #3c4043; }

/* FAB */
.md-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: 56px; height: 56px; border-radius: 16px; border: none;
  background: var(--md-sys-color-primary); color: #fff;
  font-size: 1.5rem; box-shadow: var(--md-elevation-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.md-fab:hover { filter: brightness(1.08); }

/* Auth / landing */
.md-auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #e8f0fe 0%, #f8f9fa 50%, #fff 100%);
  padding: 24px;
}
.md-auth-card {
  width: 100%; max-width: 400px; background: #fff;
  border-radius: 28px; padding: 40px 32px;
  box-shadow: var(--md-elevation-2);
}
.md-auth-card h1 { font-size: 1.5rem; font-weight: 500; color: var(--md-sys-color-primary); margin-bottom: 4px; }
.md-auth-card .sub { color: var(--md-sys-color-on-surface-variant); margin-bottom: 24px; }

.md-landing-nav {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: #fff; border-bottom: 1px solid var(--md-sys-color-outline-variant);
  position: sticky; top: 0; z-index: 50;
}
.md-landing-nav .brand { font-size: 1.25rem; font-weight: 500; color: var(--md-sys-color-primary); }
.md-hero {
  text-align: center; padding: 80px 24px 48px; max-width: 800px; margin: 0 auto;
}
.md-hero h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 500; line-height: 1.2; margin-bottom: 16px; }
.md-hero h1 span { color: var(--md-sys-color-primary); }
.md-hero p { color: var(--md-sys-color-on-surface-variant); font-size: 1.1rem; margin-bottom: 32px; }
.md-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.md-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; max-width: 1000px; margin: 0 auto 64px; padding: 0 24px;
}
.md-feature {
  background: #fff; border-radius: var(--md-radius); padding: 24px;
  box-shadow: var(--md-elevation-1); border: 1px solid var(--md-sys-color-outline-variant);
}
.md-feature h3 { font-size: 1rem; font-weight: 500; margin-bottom: 8px; }
.md-feature p { font-size: .875rem; color: var(--md-sys-color-on-surface-variant); }

/* Alerts */
.md-alert {
  padding: 12px 16px; border-radius: var(--md-radius-sm); margin-bottom: 16px;
  font-size: .875rem;
}
.md-alert-success { background: #e6f4ea; color: #137333; }
.md-alert-error { background: #fce8e6; color: #c5221f; }
.md-alert-info { background: #e8f0fe; color: #1967d2; }
.md-alert-warning { background: #fef7e0; color: #b06000; }

/* Empty */
.md-empty { text-align: center; padding: 48px 16px; color: var(--md-sys-color-on-surface-variant); }
.md-empty .icon { font-size: 48px; opacity: .4; margin-bottom: 12px; }

/* Mobile */
.md-menu-btn {
  display: none; background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--md-sys-color-on-surface); margin-right: 12px;
}
@media (max-width: 900px) {
  .md-sidebar { transform: translateX(-100%); }
  .md-sidebar.open { transform: translateX(0); box-shadow: var(--md-elevation-3); }
  .md-main { margin-left: 0; }
  .md-menu-btn { display: inline-flex; }
}

/* Avatar */
.md-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--md-sys-color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: .9rem;
}
.md-user { display: flex; align-items: center; gap: 10px; font-size: .875rem; }

/* Footer brand */
.md-footer-note {
  padding: 16px 20px; font-size: .7rem; color: var(--md-sys-color-on-surface-variant);
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
