/* ====================================
   GOOGLE FONTS — Inter
   ==================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ====================================
   DESIGN TOKENS — Raycast structure × Aiman's palette
   ==================================== */

:root {
  /* ── Surface ladder (dark navy) ── */
  --canvas:           #071424;   /* page background */
  --surface:          #0f4272;   /* cards, panels */
  --surface-elevated: #093052;   /* inputs, tertiary buttons */
  --surface-card:     #0C3F69;   /* table headers, keycaps */

  /* ── Accent ── */
  --accent:           #0C3F69;   /* soft sky blue — CTA, active states */
  --accent-soft:      rgba(180, 214, 227, 0.12);
  --accent-pressed:   #093052;
  --on-accent:        #B4D6E3;   /* dark text on accent bg */

  /* ── Mid tone ── */
  --dusty:            #7F9DB1;   /* muted accent / secondary info */

  /* ── Text ── */
  --ink:              #F1F5F9;   /* primary headings & body */
  --body-text:        #CBD5E1;   /* paragraph, secondary copy */
  --muted:            #94A3B8;   /* captions, placeholder, metadata */
  --on-dark:          #ffffff;

  /* ── Hairlines ── */
  --hairline:         rgba(255, 255, 255, 0.08);
  --hairline-strong:  rgba(255, 255, 255, 0.16);

  /* ── Semantic ── */
  --success:          #22C55E;
  --success-soft:     rgba(34, 197, 94, 0.12);
  --warning:          #F59E0B;
  --warning-soft:     rgba(245, 158, 11, 0.12);
  --error:            #EF4444;
  --error-soft:       rgba(239, 68, 68, 0.12);
  --info:             #B4D6E3;
  --info-soft:        rgba(180, 214, 227, 0.12);

  /* ── Radius (Raycast scale) ── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 10px;
  --radius-xl: 16px;

  /* ── Transition ── */
  --transition: all 0.2s ease;

  /* ── Legacy aliases (keeps JS & HTML working without changes) ── */
  --primary-color:      #0a2d54;
  --secondary-color:    #B4D6E3;
  --accent-color:       #7F9DB1;
  --success-color:      #22C55E;
  --danger-color:       #EF4444;
  --warning-color:      #F59E0B;
  --bg-color:           #0a2d54;
  --card-bg:            #0D3B66;
  --text-dark:          #F1F5F9;
  --text-light:         #94A3B8;
  --border-color:       rgba(255, 255, 255, 0.08);
  --shadow:             none;
  --shadow-md:          none;
  --shadow-lg:          none;
  --sidebar-bg:         #0a3259;
  --sidebar-hover:      rgba(180, 214, 227, 0.08);
  --sidebar-active-bg:  rgba(180, 214, 227, 0.14);
}

/* ====================================
   SCROLLBAR
   ==================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ====================================
   RESET & BASE
   ==================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: "calt", "kern", "liga", "ss03";
  font-size: 16px;
  color: var(--ink);
  background-color: var(--canvas);
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.06'/></svg>");
  background-repeat: repeat;
  background-size: 200px 200px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem;  font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.015em; }
h4 { font-size: 1.1rem;  font-weight: 500; letter-spacing: -0.01em; }
h5 { font-size: 1rem;    font-weight: 500; letter-spacing: -0.01em; }
h6 { font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }

p {
  line-height: 1.55;
  margin-bottom: 1rem;
  color: var(--body-text);
  font-size: 0.875rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--on-dark);
}

/* ====================================
   LOGIN PAGE
   ==================================== */

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse at 15% 15%, rgba(26, 84, 148, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(30, 42, 100, 0.6) 0%, transparent 50%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  display: none;
}

.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-box {
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.login-logo-icon {
  width: 180px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-icon img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
  text-align: center;
  letter-spacing: -0.01em;
}

.login-subtitle {
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
}

.login-form {
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  font-size: 0.825rem;
  margin-bottom: 0.4rem;
  color: var(--body-text);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--ink);
  background-color: var(--surface-elevated);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  font-family: inherit;
  font-feature-settings: inherit;
  height: 36px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--surface-elevated);
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #093052 inset !important;
  -webkit-text-fill-color: #F1F5F9 !important;
  caret-color: #F1F5F9;
  border-color: rgba(255,255,255,0.08) !important;
}

.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus),
.form-group textarea:hover:not(:focus) {
  border-color: var(--hairline-strong);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
  height: auto;
  padding: 0.55rem 0.75rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
  font-size: 0.875rem;
}

.form-group select option {
  background-color: var(--surface-elevated);
  color: var(--ink);
}

.error-message {
  background-color: var(--error-soft);
  color: var(--error);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 3px solid var(--error);
  font-size: 0.875rem;
}

.loading-message {
  text-align: center;
  color: var(--muted);
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.success-message {
  background-color: var(--success-soft);
  color: var(--success);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 3px solid var(--success);
  font-size: 0.875rem;
}

.warning-message {
  background-color: var(--warning-soft);
  color: var(--warning);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border-left: 3px solid var(--warning);
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ====================================
   BUTTONS
   ==================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1rem;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
  font-family: inherit;
  font-feature-settings: inherit;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Primary — accent fill */
.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-pressed);
  border-color: transparent;
  color: var(--on-accent);
}

.btn-primary:active:not(:disabled) {
  background-color: #7db8cc;
  color: var(--on-accent);
}

/* Secondary — accent soft fill */
.btn-secondary {
  background-color: var(--accent-soft);
  color: var(--on-accent);
  border-color: rgba(180, 214, 227, 0.25);
}

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(180, 214, 227, 0.2);
  color: var(--on-accent);
}

.btn-secondary:active:not(:disabled) {
  background-color: rgba(180, 214, 227, 0.28);
}

/* Semantic fills */
.btn-success {
  background-color: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.25);
}

.btn-success:hover:not(:disabled) {
  background-color: rgba(34, 197, 94, 0.2);
}

.btn-success:active:not(:disabled) {
  background-color: rgba(34, 197, 94, 0.28);
}

.btn-danger {
  background-color: var(--error-soft);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:active:not(:disabled) {
  background-color: rgba(239, 68, 68, 0.28);
}

.btn-warning {
  background-color: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.btn-warning:hover:not(:disabled) {
  background-color: rgba(245, 158, 11, 0.2);
}

.btn-warning:active:not(:disabled) {
  background-color: rgba(245, 158, 11, 0.28);
}

.btn-ghost {
  background-color: transparent;
  color: var(--muted);
  border-color: var(--hairline);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--surface-elevated);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.btn-ghost:active:not(:disabled) {
  background-color: var(--surface-card);
}

.btn-small {
  height: 28px;
  padding: 0 0.65rem;
  font-size: 0.775rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.28rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
  line-height: 1;
}

.btn-icon-edit {
  background: var(--accent-soft);
  color: var(--on-accent);
  border-color: rgba(180, 214, 227, 0.25);
}
.btn-icon-edit:hover { background: rgba(180, 214, 227, 0.18); }

.btn-icon-delete {
  background: var(--error-soft);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.25);
}
.btn-icon-delete:hover { background: rgba(239, 68, 68, 0.2); }

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.btn-block-flex {
  display: flex;
  gap: 0.5rem;
}

.btn-block-flex .btn {
  flex: 1;
}

/* ====================================
   LAYOUT
   ==================================== */

.main-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: #07243B;
  border-right: 1px solid var(--hairline);
  color: var(--ink);
  padding: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-text {
  min-width: 0;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-subtitle {
  font-size: 0.65rem;
  color: var(--muted);
  margin: 0.1rem 0 0 0;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-nav-item {
  margin: 0;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  margin: 1px 0.75rem;
  font-weight: 400;
  font-size: 0.875rem;
}

.sidebar-nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--body-text);
}

.sidebar-nav-link.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-weight: 500;
}

.nav-icon {
  display: inline-flex;
  font-size: 1rem;
  width: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-nav-link:hover .nav-icon,
.sidebar-nav-group-header:hover .nav-icon {
  opacity: 0.85;
}

.sidebar-nav-link.active .nav-icon {
  opacity: 1;
}

/* ── Collapsible nav group ── */
.sidebar-nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.875rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 1px 0.75rem;
  font-weight: 400;
  font-size: 0.875rem;
  user-select: none;
  transition: var(--transition);
}

.sidebar-nav-group-header:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--body-text);
}

.sidebar-nav-group-header.group-open {
  color: var(--ink);
}

.sidebar-nav-group-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-nav-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.sidebar-nav-group-header.group-open .sidebar-nav-chevron {
  transform: rotate(180deg);
  opacity: 0.8;
}

.sidebar-nav-subnav {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.sidebar-nav-subnav.open {
  max-height: 200px;
}

.sidebar-nav-sublink {
  display: block;
  padding: 0.4rem 0.875rem 0.4rem 2rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.835rem;
  font-weight: 400;
  border-radius: var(--radius-sm);
  margin: 1px 0.75rem;
  transition: var(--transition);
}

.sidebar-nav-sublink:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--body-text);
}

.sidebar-nav-sublink.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-weight: 500;
}

.sidebar-footer {
  padding: 0.875rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.sidebar-user-card {
  background: var(--surface-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.875rem;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--on-accent), #7F9DB1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #071424;
  flex-shrink: 0;
}

.sidebar-user-details {
  min-width: 0;
  flex: 1;
}

.sidebar-user-email {
  font-size: 0.75rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-weight: 500;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1px;
}

.sidebar-user-divider {
  height: 1px;
  background: var(--hairline);
  margin: 0;
}

.sidebar-logout-wrap {
  padding: 0.65rem 0.875rem;
}

.sidebar-logout-wrap .btn-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-color: rgba(239, 68, 68, 0.4);
}

.sidebar .btn-danger {
  width: 100%;
  font-size: 0.8rem;
}

.content {
  margin-left: 250px;
  flex: 1;
  padding: 1.75rem 2rem;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--hairline);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ====================================
   CARDS
   ==================================== */

.card {
  background-color: #07243B;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--hairline-strong);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--hairline);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.card-body {
  margin-bottom: 1.25rem;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

/* ====================================
   DASHBOARD GRID
   ==================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: #07243B;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: center;
  transition: border-color 0.2s ease;
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.stat-card:hover {
  border-color: var(--hairline-strong);
  color: inherit;
}

.stat-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--accent-soft);
  margin: 0 auto 0.875rem;
}

.stat-icon-wrap i {
  font-size: 1.1rem;
  color: var(--accent);
  line-height: 1;
}

/* Per-card icon colours — dashboard stat cards */
.dashboard-grid .stat-card:nth-child(1) .stat-icon-wrap { background-color: rgba(180, 214, 227, 0.12); }
.dashboard-grid .stat-card:nth-child(1) .stat-icon-wrap i { color: #B4D6E3; }

.dashboard-grid .stat-card:nth-child(2) .stat-icon-wrap { background-color: rgba(74, 222, 128, 0.12); }
.dashboard-grid .stat-card:nth-child(2) .stat-icon-wrap i { color: #4ADE80; }

.dashboard-grid .stat-card:nth-child(3) .stat-icon-wrap { background-color: rgba(251, 191, 36, 0.12); }
.dashboard-grid .stat-card:nth-child(3) .stat-icon-wrap i { color: #FBBF24; }

.dashboard-grid .stat-card:nth-child(4) .stat-icon-wrap { background-color: rgba(167, 139, 250, 0.12); }
.dashboard-grid .stat-card:nth-child(4) .stat-icon-wrap i { color: #A78BFA; }

.stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

/* ====================================
   BADGES
   ==================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-success {
  background-color: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-danger {
  background-color: var(--error-soft);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
  background-color: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
  background-color: var(--info-soft);
  color: var(--info);
  border: 1px solid rgba(180, 214, 227, 0.2);
}

.badge-secondary {
  background-color: var(--surface-card);
  color: var(--muted);
  border: 1px solid var(--hairline);
}

/* ====================================
   TABLES
   ==================================== */

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

thead {
  background-color: transparent;
  border-bottom: 1px solid var(--hairline-strong);
}

thead th {
  padding: 0.6rem 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.875rem;
  vertical-align: middle;
  color: var(--body-text);
  line-height: 1.4;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.table-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-image {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--hairline);
}

/* ====================================
   MODALS
   ==================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 25, 47, 0.72);
  backdrop-filter: blur(4px);
  z-index: 2000;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 1.5rem;
}

.modal.show {
  display: flex;
  animation: modalFadeIn 0.18s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-content {
  background-color: #07243B;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto 0;
  animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.modal-title {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.modal-close {
  background: var(--error-soft);
  border: 1px solid rgba(239, 68, 68, 0.25);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  color: var(--error);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.35);
}

.modal-body {
  margin-bottom: 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
}

/* ====================================
   FLOORPLAN
   ==================================== */

.floorplan-container {
  display: flex;
  gap: 2rem;
}

.floorplan-selector {
  flex: 0 0 300px;
}

.floorplan-display {
  flex: 1;
}

.floorplan-image {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  cursor: crosshair;
  position: relative;
  background-color: var(--surface-elevated);
}

.floorplan-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.coordinate-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: var(--accent);
  border: 2px solid var(--canvas);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: var(--transition);
}

.coordinate-marker:hover {
  background-color: var(--on-dark);
  width: 20px;
  height: 20px;
}

.coordinate-display {
  background-color: var(--surface-elevated);
  border: 1px solid var(--hairline);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--body-text);
}

.coordinate-display p {
  margin-bottom: 0.35rem;
  color: var(--body-text);
}

.floorplan-editor-body {
  display: flex;
  gap: 1.5rem;
  min-height: 60vh;
  overflow: hidden;
}

.floorplan-editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.floorplan-editor-sidebar {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(90vh - 140px);
  overflow-y: auto;
}

.floorplan-editor-canvas-wrapper {
  width: 100%;
  background-color: var(--surface-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 420px;
  max-height: calc(90vh - 260px);
  cursor: grab;
}

.floorplan-editor-canvas-wrapper.dragging {
  cursor: grabbing;
}

.floorplan-editor-canvas {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 70%;
  transform-origin: 0 0;
  transition: transform 0.1s ease-out;
}

.floorplan-editor-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.floorplan-editor-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: all;
}

.editor-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.875rem;
  background-color: var(--surface-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.zoom-buttons {
  display: flex;
  gap: 0.5rem;
}

.zoom-info {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.editor-room-list {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  background-color: var(--surface-elevated);
}

.editor-room-item {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.editor-room-item:last-child {
  border-bottom: none;
}

.editor-room-item:hover {
  background-color: var(--surface-card);
}

.editor-room-item.selected {
  background-color: var(--accent-soft);
  border-left: 2px solid var(--accent);
}

.editor-room-item strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--ink);
}

.editor-room-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.editor-panel-section h3 {
  margin-bottom: 0.75rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-room-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

/* ====================================
   IMAGE UPLOAD
   ==================================== */

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-input-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 2rem;
  background-color: var(--surface-elevated);
  border: 1px dashed var(--hairline-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.3rem;
}

.file-input-label:hover {
  background-color: var(--surface-card);
  border-color: var(--on-accent);
}

.file-input-label.dragover {
  background-color: var(--accent-soft);
  border-color: var(--on-accent);
}

.file-input-hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.file-input-text {
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 500;
}

.file-input-hint {
  font-size: 0.775rem;
  color: var(--muted);
}

.image-preview {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 0.75rem auto 0;
  border: 1px solid var(--hairline);
  object-fit: cover;
}

/* ====================================
   SEARCH & FILTER
   ==================================== */

.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0;
}

.search-bar input {
  flex: 1;
  padding: 0 0.875rem;
  height: 36px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--surface-elevated);
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.search-bar input:hover:not(:focus) {
  border-color: var(--hairline-strong);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-elevated);
}

.search-bar input::placeholder {
  color: var(--muted);
}

/* ====================================
   ROOMS DIRECTORY FILTERS
   ==================================== */
.rooms-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--hairline);
}
.rooms-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rooms-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.rooms-filter-pills {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.rooms-filter-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--hairline);
  background: var(--surface-elevated);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.rooms-filter-pill:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.rooms-filter-pill.active { background: #B4D6E3; color: #07243B; border-color: #B4D6E3; }
.type-seg {
  display: flex;
  background: var(--surface-elevated);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.type-seg-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.type-seg-btn i { font-size: 1.05rem; }
.type-seg-btn:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.type-seg-btn.active { background: #0C3F69; color: #B4D6E3; font-weight: 600; }
.rooms-filter-divider {
  width: 1px;
  height: 20px;
  background: var(--hairline);
  flex-shrink: 0;
}

/* ====================================
   EMPTY STATE
   ==================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.875rem;
  display: block;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0;
}

/* ====================================
   KONVA FLOORPLAN EDITOR
   ==================================== */

#editorSection {
  background-color: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--surface-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.editor-header h2 {
  font-size: 0.95rem;
  margin: 0;
  flex: 1;
  min-width: 200px;
  color: var(--ink);
}

.editor-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.editor-workspace {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 1rem;
  padding: 1.5rem;
  min-height: 600px;
}

.tool-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background-color: var(--surface-elevated);
  overflow-y: auto;
  max-height: 600px;
}

.tool-panel h3,
.tool-panel h4 {
  font-size: 0.7rem;
  margin-bottom: 0.65rem;
  margin-top: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.tool-panel h3:first-child {
  margin-top: 0;
}

.tool-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tool-btn {
  padding: 0.55rem 0.5rem;
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
  line-height: 1.2;
  font-weight: 500;
  font-family: inherit;
  color: var(--body-text);
}

.tool-btn:hover {
  background-color: var(--accent-soft);
  color: var(--on-accent);
  border-color: rgba(180, 214, 227, 0.25);
}

.tool-btn:active {
  background-color: rgba(180, 214, 227, 0.22);
  color: var(--on-accent);
  border-color: rgba(180, 214, 227, 0.35);
  transform: scale(0.97);
}

.tool-btn.active {
  background-color: rgba(180, 214, 227, 0.18);
  color: var(--on-accent);
  border-color: rgba(180, 214, 227, 0.45);
}

.tool-panel hr {
  margin: 0.875rem 0;
  border: none;
  border-top: 1px solid var(--hairline);
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 200px;
  overflow-y: auto;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.5rem;
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  gap: 0.5rem;
  transition: var(--transition);
  color: var(--body-text);
}

.list-item:hover {
  border-color: var(--hairline-strong);
  background-color: var(--surface-elevated);
}

.list-item span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.list-item button {
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  flex-shrink: 0;
  border-radius: 4px;
}

.editor-canvas {
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background-color: var(--surface-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 600px;
}

#konvaContainer {
  width: 100% !important;
  height: 100% !important;
}

.properties-panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background-color: var(--surface-elevated);
  overflow-y: auto;
  max-height: 600px;
}

.properties-panel h3 {
  font-size: 0.7rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 500;
}

.properties-panel h4 {
  font-size: 0.8rem;
  color: var(--body-text);
}

.properties-panel input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: var(--transition);
  font-family: inherit;
  color: var(--ink);
  background-color: var(--surface-card);
  height: 32px;
}

.properties-panel input:focus {
  outline: none;
  border-color: var(--hairline-strong);
}

.properties-panel button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ====================================
   TOAST NOTIFICATIONS
   ==================================== */

#toastContainer {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 280px;
  max-width: 380px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--hairline-strong);
  background-color: var(--surface-card);
  border-top: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink);
  pointer-events: all;
  transform: translateX(110%);
  transition: transform .26s cubic-bezier(.4,0,.2,1), opacity .26s;
  opacity: 0;
}

.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon  { font-size: 1rem; flex-shrink: 0; margin-top: 0.07rem; }
.toast-body  { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.1rem; color: var(--ink); }
.toast-msg   { color: var(--muted); font-size: 0.8rem; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  padding: 0; flex-shrink: 0; margin-top: -0.05rem;
  transition: var(--transition);
}
.toast-close:hover { color: var(--ink); }

.toast-success { border-left-color: var(--success); }
.toast-success .toast-icon  { color: var(--success); }
.toast-success .toast-title { color: var(--success); }

.toast-error   { border-left-color: var(--error); }
.toast-error .toast-icon    { color: var(--error); }
.toast-error .toast-title   { color: var(--error); }

.toast-warning { border-left-color: var(--warning); }
.toast-warning .toast-icon  { color: var(--warning); }
.toast-warning .toast-title { color: var(--warning); }

.toast-info    { border-left-color: var(--accent); }
.toast-info .toast-icon     { color: var(--accent); }
.toast-info .toast-title    { color: var(--accent); }

/* ====================================
   ROOM DETAIL MODAL — rd-* classes
   ==================================== */

.rd-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  background-color: var(--surface-card);
}

.rd-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rd-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(13, 59, 102, 0.85));
  padding: 24px 14px 12px;
}

.rd-hero-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-dark);
  line-height: 1.3;
}

.rd-hero-code {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.rd-hero-fallback {
  display: flex;
  align-items: center;
  gap: 14px;
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin-bottom: 12px;
}

.rd-hero-icon {
  font-size: 1.8rem;
  width: 50px; height: 50px;
  background-color: var(--accent-soft);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.rd-hero-name-dark {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.rd-hero-code-dark {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.05em;
}

.rd-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--info-soft);
  border: 1px solid rgba(180, 214, 227, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.76rem;
  color: var(--on-accent);
  margin-bottom: 10px;
  line-height: 1.4;
}

.rd-notice strong { color: var(--ink); }

.rd-section {
  background-color: var(--surface-elevated);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-top: 8px;
}

.rd-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}

.rd-section-badge {
  width: 20px; height: 20px;
  background-color: var(--accent-soft);
  color: var(--on-accent);
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.rd-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.rd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
}

.rd-row:last-child { border-bottom: none; }

.rd-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  min-width: 88px;
}

.rd-value {
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}

.rd-empty {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  font-size: 0.85rem;
}

.rd-code {
  font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
  font-size: 0.82rem;
  background-color: var(--surface-card);
  color: var(--on-accent);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  font-weight: 500;
}

.rd-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--accent-soft);
  color: var(--on-accent);
  text-transform: capitalize;
}

.rd-tag-sub {
  background-color: var(--surface-card);
  color: var(--body-text);
}

.rd-desc-block {
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
}

.rd-desc-block:last-child { border-bottom: none; }

.rd-desc-text {
  font-size: 0.86rem;
  color: var(--body-text);
  line-height: 1.55;
  margin-top: 5px;
}

.rd-lecturer-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 2px;
}

.rd-lecturer-avatar {
  width: 36px; height: 36px;
  background-color: var(--accent-soft);
  border-radius: var(--radius);
  color: var(--on-accent);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.rd-lecturer-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.rd-lecturer-dept {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.rd-lecturer-avatar--img {
  background: none;
  padding: 0;
  overflow: hidden;
}

.rd-lecturer-avatar-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.rd-vis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding-top: 2px;
}

.rd-vis-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
}

.rd-vis-item .rd-label { min-width: unset; }

.rd-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.rd-badge-green { background-color: var(--success-soft); color: var(--success); }
.rd-badge-red   { background-color: var(--error-soft);   color: var(--error);   }

/* Sidebar announcement pending badge */
.ann-badge {
  margin-left: auto;
  background-color: var(--error-soft);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

/* Announcements table status pills */
.ann-status-pending   { display:inline-block;padding:2px 10px;border-radius:99px;font-size:0.75rem;font-weight:500;background-color:var(--warning-soft);color:var(--warning); }
.ann-status-published { display:inline-block;padding:2px 10px;border-radius:99px;font-size:0.75rem;font-weight:500;background-color:var(--success-soft);color:var(--success); }
.ann-type-tag         { display:inline-block;padding:2px 8px;border-radius:var(--radius-xs);font-size:0.72rem;font-weight:500;background-color:var(--accent-soft);color:var(--on-accent); }

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 1200px) {
  .editor-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .tool-panel,
  .properties-panel,
  .editor-canvas {
    max-height: none;
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }

  .content {
    margin-left: 200px;
    padding: 1rem;
  }

  .topbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .floorplan-container {
    flex-direction: column;
  }

  .floorplan-selector {
    flex: none;
    width: 100%;
  }

  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 0.65rem 0.75rem;
  }

  .btn-small {
    height: 26px;
    padding: 0 0.6rem;
    font-size: 0.75rem;
  }

  .modal-content {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .editor-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .editor-actions {
    width: 100%;
  }

  .editor-workspace {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
    min-height: auto;
  }

  .tool-btn {
    font-size: 0.75rem;
    padding: 0.5rem;
  }

  .list-item {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 160px;
    font-size: 0.8rem;
  }

  .sidebar-title {
    font-size: 0.85rem;
  }

  .content {
    margin-left: 160px;
    padding: 0.75rem;
  }

  .login-box {
    padding: 1.75rem 1.25rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    padding: 0 0.875rem;
    font-size: 0.85rem;
  }

  .modal-content {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }

  .card {
    padding: 1rem;
  }

  .table-actions {
    flex-direction: column;
  }

  .stat-value {
    font-size: 1.75rem;
  }
}
