:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #111827;
  --muted: #667085;
  --line: #d9e1ea;
  --accent: #174ea6;
  --accent-dark: #0f3470;
  --accent-soft: #e8f0fe;
  --success: #027a48;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "Noto Sans Telugu", Arial, sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  margin: 0 auto;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  background: linear-gradient(135deg, var(--accent), #263a63);
}

.nav-actions,
.hero-actions,
.link-actions,
.icon-link,
.icon-button {
  display: flex;
  align-items: center;
}

.nav-actions,
.hero-actions {
  gap: 10px;
}

.icon-link,
.icon-button {
  justify-content: center;
  gap: 8px;
}

.nav-link,
.button-link,
.ghost-link {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-link {
  color: var(--muted);
}

.nav-link:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.button-link,
button {
  border: 0;
  color: #ffffff;
  background: var(--accent);
}

.button-link:hover,
button:hover {
  background: var(--accent-dark);
}

.ghost-link {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.ghost-link:hover {
  border-color: #b8c5d6;
  background: var(--panel-soft);
}

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

.home-shell,
.home-links-shell,
.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.home-shell {
  padding: 58px 0;
}

.home-links-shell {
  padding: 32px 0 48px;
}

.home-links-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.home-links-head h1 {
  font-size: clamp(34px, 4vw, 52px);
}

.home-links-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.home-links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-decoration: none;
  background: #ffffff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.home-link-card:hover {
  border-color: #b8c5d6;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  transform: translateY(-1px);
}

.favicon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.home-link-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.home-link-content strong,
.home-link-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-link-content strong {
  color: var(--text);
  font-size: 16px;
}

.home-link-content span {
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  gap: 36px;
  min-height: calc(100vh - 190px);
}

.hero-copy-block {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.hero-copy,
.section-copy,
.panel-heading p,
.table-toolbar p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy {
  max-width: 650px;
  margin: 22px 0 26px;
  font-size: 18px;
}

.overview-panel,
.panel,
.links-section,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-panel {
  padding: 22px;
}

.overview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.overview-header .material-symbols-outlined {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.overview-header p,
.overview-grid span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 18px;
}

.overview-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.overview-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.app {
  padding: 32px 0 48px;
}

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-head h1 {
  font-size: clamp(34px, 4vw, 52px);
}

.section-copy {
  margin: 12px 0 0;
}

.count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  background: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.stat-card .material-symbols-outlined {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.stat-card p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  max-width: 240px;
  overflow: hidden;
  font-size: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel,
.links-section {
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading p,
.table-toolbar p {
  margin-bottom: 0;
}

.link-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.2fr) auto;
  align-items: end;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.tools input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  background: #ffffff;
}

.field input:focus,
.tools input:focus {
  outline: 3px solid rgba(23, 78, 166, 0.16);
  border-color: var(--accent);
}

button {
  min-height: 44px;
  border-radius: 6px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.icon-only {
  display: inline-grid;
  width: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
}

.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: #ffffff;
}

.secondary:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fda29b;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(360px, calc(100vw - 32px));
  max-width: 420px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast .material-symbols-outlined {
  flex: 0 0 auto;
}

.toast-success {
  border-color: #abefc6;
  color: var(--success);
  background: var(--success-soft);
}

.toast-warning {
  border-color: #fedf89;
  color: var(--warning);
  background: var(--warning-soft);
}

.toast-error {
  border-color: #fda29b;
  color: var(--danger);
  background: var(--danger-soft);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.52);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.26);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.links-section {
  margin-top: 18px;
}

.table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tools {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
}

.links-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.link-card:last-child {
  border-bottom: 0;
}

.link-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.link-title {
  margin: 0;
  font-size: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  background: #ecfdf3;
}

.link-url,
.link-meta {
  color: var(--muted);
}

.link-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-url:hover {
  color: var(--accent);
}

.link-meta {
  margin: 8px 0 0;
  font-size: 13px;
}

.link-actions {
  justify-content: flex-end;
  gap: 8px;
}

.open-link,
.edit-link,
.delete-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 12px;
  font-weight: 800;
  text-decoration: none;
}

.open-link {
  color: #ffffff;
  background: var(--accent);
}

.open-link:hover {
  background: var(--accent-dark);
}

.edit-link {
  border: 1px solid #b8c5d6;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.edit-link:hover {
  background: #d7e5ff;
}

.delete-link {
  border: 1px solid var(--line);
  color: var(--danger);
  background: #ffffff;
}

.delete-link:hover {
  background: var(--danger-soft);
  border-color: #fda29b;
}

.empty-state {
  padding: 46px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state .material-symbols-outlined {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 34px;
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 22px;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .navbar,
  .home-shell,
  .home-links-shell,
  .app {
    width: min(100% - 20px, 1180px);
  }

  .hero,
  .stats-grid,
  .link-form,
  .table-toolbar,
  .tools,
  .link-card {
    grid-template-columns: 1fr;
  }

  .table-toolbar,
  .dashboard-head,
  .home-links-head {
    display: grid;
  }

  .overview-panel {
    max-width: 520px;
  }

  .link-actions {
    justify-content: stretch;
  }

  .open-link,
  .edit-link,
  .delete-link {
    flex: 1;
  }
}

@media (max-width: 620px) {
  .navbar {
    min-height: auto;
    padding: 12px 0;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-link,
  .button-link,
  .ghost-link {
    min-height: 38px;
    padding: 0 10px;
    font-size: 14px;
  }

  .nav-link span:last-child {
    display: none;
  }

  .home-shell {
    padding: 36px 0;
  }

  .hero-actions {
    display: grid;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .links-section {
    padding: 16px;
  }

  .modal-actions {
    display: grid;
  }

  .toast {
    right: 10px;
    bottom: 10px;
  }

  .link-actions {
    display: grid;
  }
}
