/* Dino System | Arzi - Minimal UI
   Notes:
   - Pure CSS, no frameworks
   - Keeps legacy classes (.btn, .form-control, .alert, etc.) so your modules render nicely
*/
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn-font@v33.003/dist/font-face.css');

:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(17,24,39,.06);
  --shadow-sm: 0 4px 14px rgba(17,24,39,.07);
  --primary: #0f3d8b;        /* Navy */
  --primary-2: #1d4ed8;      /* Accent */
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 16px;
  --radius-sm: 12px;
  --focus: 0 0 0 4px rgba(29,78,216,.18);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  padding:0;
  direction:rtl;
  text-align:right;
  font-family:'Vazirmatn', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(29,78,216,.10), transparent 60%),
              radial-gradient(900px 400px at 10% 10%, rgba(15,61,139,.08), transparent 55%),
              var(--bg);
  color:var(--text);
}

/* -------- Layout shell -------- */
.app-shell{
  min-height:100%;
  display:flex;
  gap:18px;
  padding:18px;
}

.sidebar{
  width:270px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position:sticky;
  top:18px;
  height: calc(100vh - 36px);
  overflow:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:18px 16px 10px;
}
.brand .brand-text{
  line-height:1.05;
}
.brand .brand-title{
  font-weight:800;
  font-size:18px;
  letter-spacing:-.2px;
}
.brand .brand-sub{
  display:inline-block;
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.sidebar .nav{
  padding:10px 10px 14px;
}
.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  margin:6px 0;
  border-radius: 14px;
  text-decoration:none;
  color:var(--text);
  border:1px solid transparent;
  transition: .15s ease;
}
.nav a .hint{ font-size:12px; color:var(--muted); }
.nav a:hover{
  background: rgba(29,78,216,.06);
  border-color: rgba(29,78,216,.18);
}
.nav a.active{
  background: rgba(29,78,216,.10);
  border-color: rgba(29,78,216,.25);
}
.sidebar .sidebar-footer{
  padding:14px 14px 18px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
}

/* Content area */
.content{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  background: rgba(255,255,255,.80);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.topbar .page-title{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.topbar .page-title .t1{ font-weight:800; font-size:16px; }
.topbar .page-title .t2{ color:var(--muted); font-size:12px; }

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.75);
}
.user-chip .u{
  font-weight:700;
  font-size:13px;
}
.user-chip a{
  text-decoration:none;
  color:var(--primary);
  font-weight:700;
  font-size:13px;
}
.user-chip a:hover{ text-decoration:underline; }

/* Mobile sidebar toggle */
.mobile-toggle{
  display:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.85);
  padding:8px 10px;
  border-radius: 12px;
  cursor:pointer;
  font-family:inherit;
  font-weight:800;
}
.mobile-toggle:focus{ outline:none; box-shadow:var(--focus); }

.card{
  background: rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
  min-width:0;
}
.card h1{
  margin:0 0 14px 0;
  font-size:18px;
  font-weight:900;
  letter-spacing:-.2px;
}

/* -------- Legacy module helpers -------- */
.module-content{ width:100%; }
.form-section{
  background: var(--surface-2);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:14px;
  margin: 12px 0;
}
.form-section.split-section{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.form-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
.form-half{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.form-group label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin: 0 0 6px 0;
}
.form-group.checkbox-group{
  display:flex;
  align-items:center;
  gap:10px;
  padding-top: 22px;
}
.form-control{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size:14px;
  background: #fff;
  transition: .15s ease;
}
.form-control:focus{
  outline:none;
  border-color: rgba(29,78,216,.45);
  box-shadow: var(--focus);
}

.btn{
  border:1px solid transparent;
  padding:10px 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition: .15s ease;
  user-select:none;
}
.btn:focus{ outline:none; box-shadow:var(--focus); }

.btn-primary{ background: var(--primary); color:#fff; }
.btn-primary:hover{ filter: brightness(1.06); }

.btn-success{ background: var(--success); color:#fff; }
.btn-danger{ background: var(--danger); color:#fff; }
.btn-sm{ padding:7px 10px; border-radius:10px; font-size:12px; font-weight:800; }
.full-width{ width:100%; }

.alert{
  border:1px solid var(--border);
  border-radius: 14px;
  padding:12px 14px;
  margin: 10px 0 14px;
  background: #fff;
}
.alert-success{ border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.08); }
.alert-error, .alert-danger{ border-color: rgba(220,38,38,.25); background: rgba(220,38,38,.08); }
.alert-warning{ border-color: rgba(217,119,6,.25); background: rgba(217,119,6,.08); }

.table-responsive{ width:100%; overflow:auto; border-radius: 14px; border:1px solid var(--border); background:#fff; }
table{ width:100%; border-collapse:collapse; min-width: 720px; }
thead th{
  position:sticky;
  top:0;
  background: #f8fafc;
  border-bottom:1px solid var(--border);
  font-size:12px;
  color:var(--muted);
  padding:12px 10px;
  text-align:right;
  white-space:nowrap;
}
tbody td{
  padding:12px 10px;
  border-bottom:1px solid var(--border);
  font-size:13px;
  vertical-align:middle;
  white-space:nowrap;
}
tbody tr:nth-child(odd){ background: #fcfdff; }
tbody tr:hover{ background: rgba(29,78,216,.06); }

.debit{ color: var(--danger); font-weight:800; }
.credit{ color: var(--success); font-weight:800; }

/* -------- Login page (kept & improved) -------- */
.login-container{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px;
}
.login-box{
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}
.login-title{
  margin: 0 0 10px 0;
  font-weight: 900;
  font-size: 20px;
}
.login-subtitle{
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 13px;
}

/* -------- Responsive -------- */
@media (max-width: 980px){
  .form-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px){
  .app-shell{ padding: 12px; }
  .sidebar{
    position:fixed;
    top:12px;
    right:12px;
    height: calc(100vh - 24px);
    z-index:50;
    transform: translateX(110%);
    transition: .18s ease;
  }
  .sidebar.open{ transform: translateX(0); }
  .mobile-toggle{ display:inline-flex; }
}
@media (max-width: 640px){
  .form-grid, .form-half, .form-section.split-section{ grid-template-columns: 1fr; }
  table{ min-width: 560px; }
}

/* Print friendly */
@media print{
  body{ background:#fff; }
  .sidebar, .topbar .mobile-toggle, .user-chip{ display:none !important; }
  .app-shell{ padding:0; }
  .card{ box-shadow:none; border:1px solid #ddd; }
}


/* -------- Login brand tweaks (Dino System | Arzi) -------- */
.login-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
.login-brand img{
  width:52px;
  height:52px;
  border-radius: 14px;
  background: rgba(29,78,216,.06);
  border:1px solid rgba(29,78,216,.18);
  padding:8px;
}
.login-brand .t1{
  font-weight:900;
  font-size:20px;
  margin:0;
  line-height:1.1;
}
.login-brand .t2{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}
.login-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-top:12px;
}
.login-actions a{
  font-size:12px;
  color:var(--muted);
  text-decoration:none;
}
.login-actions a:hover{ text-decoration:underline; }
