:root{
  --brand-primary: #1f7f79;
  --brand-secondary: #f59e0b;
  --brand-bg: #f2f5f9;
  --brand-text: #0f172a;
  --brand-surface: #ffffff;
  --brand-border: rgba(15,23,42,0.08);
  --brand-shadow: 0 18px 40px rgba(15,23,42,0.08);
  --radius-lg: 18px;
  --radius-md: 14px;
}

*{box-sizing:border-box;}
body{
  font-family: "DM Sans", "Space Grotesk", sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.ns-app{
  min-height: 100vh;
  background: var(--brand-bg);
}

.ns-topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--brand-border);
}

.ns-topbar-pwa{
  background: rgba(15,23,42,0.92);
  color: #fff;
}

.ns-topbar-link{
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.ns-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
}

.ns-logo{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: .04em;
}

.ns-topbar-actions{
  display: flex;
  align-items: center;
  gap: 12px;
}

.ns-user{
  font-weight: 600;
  color: var(--brand-text);
}

.ns-layout{
  display: flex;
  min-height: calc(100vh - 72px);
}

.ns-sidebar{
  width: 250px;
  padding: 20px 16px;
  background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(15,23,42,0.9));
  color: #e2e8f0;
}

.ns-menu-title{
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  padding: 10px 12px;
  color: rgba(226,232,240,0.6);
}

.ns-nav-link{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #f1f5f9;
  margin-bottom: 6px;
  transition: background .2s ease, transform .2s ease;
}

.ns-nav-link:hover{
  background: rgba(31,127,121,0.2);
  transform: translateX(2px);
}

.ns-nav-link.active{
  background: rgba(31,127,121,0.35);
  position: relative;
}

.ns-nav-link.active::before{
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--brand-secondary);
}

.ns-content{
  flex: 1;
  padding: 24px 30px 40px;
}

.ns-content-pwa{
  padding: 20px 16px 32px;
}

.ns-card{
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--brand-shadow);
  margin-bottom: 18px;
  animation: ns-rise .6s ease both;
}

.ns-card-compact{
  padding: 14px 16px;
}

.ns-card-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ns-card-header h3{
  margin: 0;
  font-size: 16px;
}

.ns-card-body{
  color: var(--brand-text);
}

.ns-card-actions{
  display: flex;
  gap: 8px;
}

.ns-hero{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(31,127,121,0.12), rgba(245,158,11,0.12));
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.ns-hero h1{
  margin: 0 0 4px;
  font-size: 24px;
}

.ns-hero p{
  margin: 0;
  color: rgba(15,23,42,0.7);
}

.ns-hero-actions{
  display: flex;
  gap: 10px;
}

.ns-hero-pwa{
  flex-direction: column;
  align-items: flex-start;
}

.ns-grid-4{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ns-grid-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ns-grid-1{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.ns-metric-label{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(15,23,42,0.6);
}

.ns-metric-value{
  font-size: 24px;
  font-weight: 700;
}

.ns-inline{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ns-status{
  display: flex;
  align-items: center;
  gap: 10px;
}

.ns-status-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 6px rgba(31,127,121,0.12);
}

.ns-btn{
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.ns-btn-primary{
  background: linear-gradient(135deg, var(--brand-primary), #145b57);
  color: #fff;
}

.ns-btn-secondary{
  background: rgba(245,158,11,0.2);
  color: #9a3412;
}

.ns-btn-outline{
  background: #fff;
  border: 1px solid rgba(15,23,42,0.12);
  color: var(--brand-text);
}

.ns-btn-ghost{
  background: transparent;
  color: var(--brand-text);
}

.ns-btn-danger{
  background: #ef4444;
  color: #fff;
}

.ns-btn-sm{padding: 6px 12px; font-size: 12px;}
.ns-btn-lg{padding: 12px 18px; font-size: 15px;}

.ns-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15,23,42,0.12);
}

.ns-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ns-label{
  font-size: 12px;
  color: rgba(15,23,42,0.7);
}

.ns-input,
.ns-select,
textarea.ns-input{
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.ns-input:focus,
.ns-select:focus,
textarea.ns-input:focus{
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(31,127,121,0.12);
}

.ns-input-error{
  border-color: #ef4444;
}

.ns-error{
  color: #ef4444;
  font-size: 12px;
}

.ns-form-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ns-form-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.ns-full{
  grid-column: 1 / -1;
}

.ns-filter{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ns-table{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ns-table-head,
.ns-table-row{
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
}

.ns-table-4 .ns-table-head,
.ns-table-4 .ns-table-row{
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ns-table-3 .ns-table-head,
.ns-table-3 .ns-table-row{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ns-table-head{
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(15,23,42,0.6);
}

.ns-table-row{
  background: #fff;
  border: 1px solid rgba(15,23,42,0.08);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}

.ns-table-row:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15,23,42,0.12);
}

.ns-pill{
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31,127,121,0.12);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 600;
}

.ns-detail-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ns-muted{
  color: rgba(15,23,42,0.6);
  font-size: 12px;
}

.ns-strong{
  font-weight: 600;
}

.ns-link{
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

.ns-pagination{
  margin-top: 16px;
}

.ns-checkbox{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.ns-theme-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.ns-theme-card{
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fff;
}

.ns-auth{
  background: radial-gradient(circle at top, rgba(31,127,121,0.12), transparent 55%), var(--brand-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.ns-auth-shell{
  width: min(440px, 100%);
}

.ns-auth-card{
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--brand-shadow);
}

.ns-auth-brand{
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.ns-auth-brand h1{
  margin: 0;
  font-size: 20px;
}

.ns-auth-brand p{
  margin: 4px 0 0;
  color: rgba(15,23,42,0.6);
}

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

@keyframes ns-rise{
  from{opacity:0;transform:translateY(14px);}
  to{opacity:1;transform:translateY(0);}
}

@media (max-width: 1100px){
  .ns-grid-4{grid-template-columns: repeat(2, minmax(0, 1fr));}
  .ns-detail-grid{grid-template-columns: repeat(2, minmax(0, 1fr));}
}

@media (max-width: 900px){
  .ns-layout{flex-direction: column;}
  .ns-sidebar{width: 100%; display: flex; flex-wrap: wrap; gap: 8px;}
  .ns-nav-link{flex: 1 1 48%;}
  .ns-form-grid{grid-template-columns: 1fr;}
  .ns-table-head,
  .ns-table-row{grid-template-columns: 1fr 1fr;}
}

@media (max-width: 680px){
  .ns-grid-4,
  .ns-grid-2{grid-template-columns: 1fr;}
  .ns-topbar-actions{flex-direction: column; align-items: flex-end;}
  .ns-filter{flex-direction: column; align-items: stretch;}
}
