:root{
  --bg:#eef2f7;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#2563eb;
  --danger:#dc2626;
  --warning:#f59e0b;
  --success:#16a34a;
  --sidebar1:#07152f;
  --sidebar2:#0d2148;
  --orange1:#ff8a00;
  --orange2:#ff5e00;
  --border:#dbe4ef;
  --shadow:0 12px 30px rgba(15,23,42,.08), 0 2px 8px rgba(15,23,42,.05);
}

*{
  box-sizing:border-box;
}

html, body{
  margin:0;
  padding:0;
}

body{
  font-family:Arial, Helvetica, sans-serif;
  background:linear-gradient(180deg,#eef2f7 0%, #e9edf5 100%);
  color:var(--text);
}

img{
  max-width:100%;
}

a{
  color:inherit;
}

.sidebar{
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  width:220px;
  background:linear-gradient(180deg,var(--sidebar2) 0%, var(--sidebar1) 100%);
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:10px;
  box-shadow:6px 0 30px rgba(2,6,23,.22);
  overflow-y:auto;
  z-index:20;
}

.brand-wrap{
  margin-bottom:12px;
  padding:6px 4px 14px 4px;
  border-bottom:1px solid rgba(255,255,255,.08);
  max-width:100%;
  overflow:hidden;
  text-align:center;
}

.sidebar-logo-img{
  width:100%;
  max-width:180px;
  max-height:92px;
  display:block;
  margin:0 auto;
  object-fit:contain;
}

.brand{
  font-size:24px;
  line-height:1;
  font-weight:900;
  letter-spacing:.5px;
  background:linear-gradient(180deg,#ffbd59 0%, #ff8a00 45%, #ff5e00 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  text-shadow:
    0 1px 0 rgba(255,255,255,.12),
    0 2px 0 rgba(0,0,0,.18),
    0 6px 14px rgba(255,94,0,.22);
  filter:drop-shadow(0 3px 8px rgba(255,140,0,.12));
  white-space:nowrap;
  overflow:hidden;
}

.brand-sub{
  margin-top:6px;
  font-size:11px;
  letter-spacing:2px;
  text-transform:uppercase;
  color:#cbd5e1;
  opacity:.82;
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.sidebar a{
  color:#e5e7eb;
  text-decoration:none;
  padding:13px 14px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.03);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
  transition:.18s ease;
  font-weight:600;
  display:block;
}

.sidebar a:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.09);
  box-shadow:0 10px 18px rgba(0,0,0,.16);
}

.content{
  margin-left:220px;
  padding:30px;
  min-height:100vh;
}

.content-full{
  padding:28px;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

.page-title{
  font-size:42px;
  margin:6px 0 18px 0;
  font-weight:900;
  letter-spacing:-1px;
  color:#0f172a;
  text-shadow:0 1px 0 rgba(255,255,255,.7);
}

.page-subtitle{
  margin:0 0 16px;
  color:var(--muted);
}

.card{
  background:var(--card);
  border-radius:20px;
  padding:22px;
  box-shadow:var(--shadow);
  margin-bottom:20px;
  border:1px solid rgba(255,255,255,.7);
}

.hero-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(135deg,#ffffff 0%, #f8fbff 100%);
  border-radius:24px;
  padding:26px;
  margin-bottom:22px;
  box-shadow:
    0 14px 35px rgba(15,23,42,.07),
    inset 0 1px 0 rgba(255,255,255,.9);
  border:1px solid rgba(255,255,255,.9);
}

.hero-card::before{
  content:"";
  position:absolute;
  right:-80px;
  top:-80px;
  width:240px;
  height:240px;
  background:radial-gradient(circle, rgba(37,99,235,.14) 0%, rgba(37,99,235,0) 68%);
}

.hero-label{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:1.4px;
  color:#64748b;
  font-weight:800;
  margin-bottom:10px;
}

.hero-value{
  font-size:34px;
  font-weight:900;
  color:#0f172a;
  letter-spacing:-.8px;
  line-height:1.2;
}

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

.stat-card{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  padding:26px 20px;
  min-height:150px;
  color:#fff;
  box-shadow:
    0 16px 30px rgba(15,23,42,.14),
    inset 0 1px 0 rgba(255,255,255,.14);
  transform:translateZ(0);
}

.stat-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 55%);
  pointer-events:none;
}

.stat-card::after{
  content:"";
  position:absolute;
  right:-30px;
  bottom:-30px;
  width:120px;
  height:120px;
  border-radius:50%;
  background:rgba(255,255,255,.12);
}

.stat-blue{
  background:linear-gradient(135deg,#2563eb 0%, #1d4ed8 100%);
}

.stat-indigo{
  background:linear-gradient(135deg,#4f46e5 0%, #4338ca 100%);
}

.stat-orange{
  background:linear-gradient(135deg,#ff8a00 0%, #ff5e00 100%);
}

.stat-green{
  background:linear-gradient(135deg,#16a34a 0%, #15803d 100%);
}

.stat-title{
  position:relative;
  z-index:2;
  font-size:18px;
  font-weight:800;
  opacity:.96;
  margin-bottom:18px;
  text-shadow:0 1px 0 rgba(0,0,0,.12);
}

.stat-number{
  position:relative;
  z-index:2;
  font-size:58px;
  line-height:1;
  font-weight:900;
  letter-spacing:-2px;
  text-shadow:
    0 2px 0 rgba(0,0,0,.14),
    0 10px 18px rgba(0,0,0,.18);
}

.stat-money{
  position:relative;
  z-index:2;
  font-size:42px;
  line-height:1.1;
  font-weight:900;
  letter-spacing:-1px;
  text-shadow:
    0 2px 0 rgba(0,0,0,.14),
    0 10px 18px rgba(0,0,0,.18);
}

.grid.two{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.grid.one{
  display:grid;
  grid-template-columns:1fr;
  gap:18px;
}

.form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.form-grid.single{
  grid-template-columns:1fr;
}

.form-actions{
  margin-top:10px;
}

label{
  display:block;
  font-size:14px;
  margin:12px 0 6px;
  color:var(--muted);
  font-weight:700;
}

input,select,button,textarea{
  width:100%;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid #d1d5db;
  font-size:14px;
}

input,select,textarea{
  background:#fff;
  box-shadow:inset 0 1px 3px rgba(15,23,42,.04);
}

textarea{
  min-height:110px;
  resize:vertical;
}

button{
  background:linear-gradient(180deg,#3b82f6 0%, #2563eb 100%);
  color:#fff;
  border:none;
  cursor:pointer;
  font-weight:800;
  box-shadow:
    0 8px 18px rgba(37,99,235,.22),
    inset 0 1px 0 rgba(255,255,255,.2);
}

button:hover{
  transform:translateY(-1px);
}

button.danger{
  background:linear-gradient(180deg,#ef4444 0%, #dc2626 100%);
  box-shadow:0 8px 18px rgba(220,38,38,.22);
}

button.warning{
  background:linear-gradient(180deg,#fbbf24 0%, #f59e0b 100%);
  color:#111;
  box-shadow:0 8px 18px rgba(245,158,11,.22);
}

button.success{
  background:linear-gradient(180deg,#22c55e 0%, #16a34a 100%);
  box-shadow:0 8px 18px rgba(22,163,74,.22);
}

button.secondary{
  background:linear-gradient(180deg,#64748b 0%, #475569 100%);
  box-shadow:0 8px 18px rgba(71,85,105,.22);
}

.filters{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:end;
}

.filters.three{
  grid-template-columns:1fr 1fr 1fr auto;
}

.filters.four{
  grid-template-columns:1fr 1fr 1fr 1fr auto;
}

.table-wrap{
  overflow-x:auto;
  width:100%;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
  min-width:760px;
}

th,td{
  border-bottom:1px solid #e5e7eb;
  padding:10px;
  text-align:left;
  vertical-align:top;
}

th{
  white-space:nowrap;
}

.big{
  font-size:28px;
  font-weight:700;
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:20px;
}

.kpi-card{
  background:#fff;
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
}

.kpi-label{
  color:var(--muted);
  font-size:14px;
  font-weight:700;
  margin-bottom:8px;
}

.kpi-value{
  font-size:30px;
  font-weight:900;
}

.flashes{
  margin-bottom:16px;
}

.flash{
  padding:12px 14px;
  border-radius:12px;
  margin-bottom:10px;
  box-shadow:0 6px 14px rgba(15,23,42,.06);
}

.flash.success{background:#dcfce7;}
.flash.danger{background:#fee2e2;}
.flash.warning{background:#fef3c7;}
.flash.info{background:#dbeafe;}

.inline-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.inline-form input,
.inline-form button,
.inline-form select{
  width:auto;
}

.actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}

.actions form{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}

.badge.success{background:#dcfce7;color:#166534;}
.badge.warning{background:#fef3c7;color:#92400e;}
.badge.danger{background:#fee2e2;color:#991b1b;}
.badge.info{background:#dbeafe;color:#1d4ed8;}

.preview-image{
  max-height:110px;
  border-radius:12px;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}

.settings-preview{
  margin-top:10px;
}

@media (max-width:1200px){
  .stats-grid,
  .kpi-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width:900px){
  body{
    overflow-x:hidden;
  }

  .sidebar{
    position:static;
    width:100%;
    height:auto;
    padding:14px;
    box-shadow:none;
    border-radius:0 0 18px 18px;
  }

  .brand-wrap{
    padding:8px 4px 12px 4px;
  }

  .sidebar-logo-img{
    max-width:150px;
    max-height:72px;
  }

  .sidebar-nav{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .sidebar a{
    padding:14px 12px;
    text-align:center;
    border-radius:16px;
    font-size:15px;
  }

  .content{
    margin-left:0;
    padding:18px;
  }

  .content-full{
    padding:18px;
  }

  .page-title{
    font-size:28px;
    margin:4px 0 14px 0;
  }

  .hero-card{
    padding:20px;
    border-radius:20px;
  }

  .hero-value{
    font-size:24px;
  }

  .stats-grid,
  .grid.two,
  .form-grid,
  .kpi-grid{
    grid-template-columns:1fr;
    gap:14px;
  }

  .stat-card{
    min-height:120px;
    padding:22px 18px;
  }

  .stat-title{
    font-size:17px;
    margin-bottom:12px;
  }

  .stat-number{
    font-size:42px;
  }

  .stat-money{
    font-size:30px;
  }

  .card{
    padding:18px;
    border-radius:18px;
  }

  .filters,
  .filters.three,
  .filters.four{
    grid-template-columns:1fr;
  }

  table{
    min-width:640px;
  }

  .inline-form{
    flex-direction:column;
    align-items:stretch;
  }

  .inline-form input,
  .inline-form button,
  .inline-form select{
    width:100%;
  }

  .actions{
    flex-direction:column;
    align-items:stretch;
  }

  .actions form{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }
}

@media (max-width:480px){
  .sidebar-nav{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .sidebar a{
    font-size:14px;
    padding:12px 10px;
  }

  .sidebar-logo-img{
    max-width:130px;
    max-height:62px;
  }

  .page-title{
    font-size:24px;
  }

  .hero-value{
    font-size:21px;
  }

  .stat-number{
    font-size:36px;
  }

  .stat-money{
    font-size:26px;
  }

  .card{
    padding:14px;
  }
}
