@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --secondary: #7209b7;
  --accent: #f72585;
  --success: #06d6a0;
  --warning: #ffd166;
  --danger: #ef233c;
  --info: #4cc9f0;
  --light: #f8f9fa;
  --dark: #212529;
  --sidebar-bg: #0d1b2a;
  --sidebar-width: 260px;
  --topbar-height: 65px;
  --optionsbar-height: 48px;
  --card-shadow: 0 4px 20px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: all .25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', sans-serif;
  background: #f0f2f8;
  color: #2d3748;
  direction: rtl;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  overflow-y: auto;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand .brand-name { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.3; }
.sidebar-brand .brand-sub { color: rgba(255,255,255,.45); font-size: 11px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section-title {
  padding: 18px 20px 6px;
  font-size: 10px; text-transform: uppercase;
  color: rgba(255,255,255,.3); letter-spacing: 1.5px; font-weight: 600;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-radius: 0;
  transition: var(--transition);
  font-size: 14px;
  position: relative;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  padding-right: 28px;
}
.sidebar-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(67,97,238,.4), rgba(114,9,183,.3));
  border-right: 3px solid var(--primary);
  padding-right: 17px;
}
.sidebar-link .nav-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  background: rgba(255,255,255,.06);
  transition: var(--transition);
}
.sidebar-link.active .nav-icon, .sidebar-link:hover .nav-icon {
  background: rgba(67,97,238,.4);
  color: var(--primary);
}
.sidebar-link .badge-count {
  margin-right: auto;
  background: var(--accent);
  color: #fff; font-size: 10px;
  padding: 2px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 10px; padding: 10px 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.user-info .user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-info .user-role { color: rgba(255,255,255,.4); font-size: 11px; }

/* ── Main Content ── */
.main-content {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.topbar-title { font-size: 18px; font-weight: 700; color: #1a1f36; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn-topbar {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid #e8ecf0;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  color: #6b7280; font-size: 16px;
  text-decoration: none;
}
.btn-topbar:hover { background: #f0f2f8; color: var(--primary); border-color: var(--primary); }

/* ── Page Content ── */
.page-content { padding: 28px 24px; flex: 1; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0f2f5;
  display: flex; align-items: center; gap: 12px;
  background: transparent;
}
.card-header h5 { font-size: 15px; font-weight: 700; color: #1a1f36; margin: 0; }
.card-header .header-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.card-body { padding: 22px; }

/* ── Stat Cards ── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(0,0,0,.04);
  display: flex; align-items: center; gap: 18px;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.stat-icon {
  width: 58px; height: 58px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-info .stat-value { font-size: 28px; font-weight: 800; line-height: 1; color: #1a1f36; }
.stat-info .stat-label { font-size: 13px; color: #8896a7; margin-top: 4px; }

.stat-primary .stat-icon { background: #eef1fd; color: var(--primary); }
.stat-success .stat-icon { background: #e8faf5; color: #06d6a0; }
.stat-warning .stat-icon { background: #fff8e7; color: #f4a900; }
.stat-danger .stat-icon  { background: #feeaed; color: var(--danger); }
.stat-info2 .stat-icon   { background: #e8f6fd; color: #0ea5e9; }
.stat-purple .stat-icon  { background: #f3e8ff; color: var(--secondary); }

/* ── Buttons ── */
.btn {
  font-family: 'Vazirmatn', sans-serif;
  font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  display: inline-flex; align-items: center; gap: 7px;
  border: none; cursor: pointer; transition: var(--transition);
  text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #3a0ca3); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); color: #fff; }
.btn-success { background: linear-gradient(135deg, #06d6a0, #059669); color: #fff; }
.btn-success:hover { filter: brightness(1.1); color: #fff; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #c1121f); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); color: #fff; }
.btn-warning { background: linear-gradient(135deg, #ffd166, #f4a900); color: #333; }
.btn-info { background: linear-gradient(135deg, var(--info), #0ea5e9); color: #fff; }
.btn-outline-primary { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-light { background: #f0f2f8; color: #4a5568; border: 1px solid #e2e8f0; }
.btn-light:hover { background: #e2e8f0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ── Tables ── */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th {
  background: #f8fafc; color: #64748b;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 12px 16px; text-align: right;
  border-bottom: 2px solid #e8ecf0;
}
td { padding: 14px 16px; border-bottom: 1px solid #f0f4f8; font-size: 13.5px; vertical-align: middle; }
tr:hover td { background: #fafbff; }
tr:last-child td { border-bottom: none; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; display: block; }
.form-hint { font-size: 11px; color: var(--primary); margin-top: 4px; display: block; font-weight: 600; }
.form-control, .form-select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #e2e8f0; border-radius: var(--radius-sm);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 14px; color: #2d3748;
  background: #fff; transition: var(--transition);
  outline: none; direction: rtl;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.form-control::placeholder { color: #9ca3af; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* ── Badges ── */
.badge {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge-issued { background: #e8faf5; color: #059669; }
.badge-draft { background: #fef9ee; color: #d97706; }
.badge-revoked { background: #feeaed; color: #dc2626; }
.badge-primary { background: #eef1fd; color: var(--primary); }

/* ── Alerts ── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.alert-success { background: #e8faf5; color: #059669; border: 1px solid #a7f3d0; }
.alert-danger { background: #feeaed; color: #dc2626; border: 1px solid #fca5a5; }
.alert-warning { background: #fef9ee; color: #d97706; border: 1px solid #fde68a; }
.alert-info { background: #eff8ff; color: #0ea5e9; border: 1px solid #bfdbfe; }

/* ── Upload Zone ── */
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer; transition: var(--transition);
  background: #fafbff;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: #eef1fd;
}
.upload-zone .upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-zone p { color: #64748b; font-size: 14px; }

/* ── Image Cards (Seals / Signatures) ── */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.asset-card {
  background: #fff; border-radius: var(--radius);
  border: 2px solid #e8ecf0;
  overflow: hidden; transition: var(--transition);
  cursor: pointer;
}
.asset-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(67,97,238,.15); }
.asset-card-img {
  height: 130px; display: flex; align-items: center; justify-content: center;
  background: #f8fafc; padding: 10px;
}
.asset-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset-card-body { padding: 10px 12px; border-top: 1px solid #f0f2f5; }
.asset-card-name { font-size: 12px; font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card-sub { font-size: 11px; color: #9ca3af; }

/* ── Designer ── */
.designer-options-bar {
  height: var(--optionsbar-height);
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  display: flex; align-items: center;
  padding: 0 14px; gap: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}
.designer-options-bar::-webkit-scrollbar { height: 3px; }
.designer-options-bar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.designer-options-bar .toolbar-sep { flex-shrink: 0; }
.designer-options-bar .toolbar-btn { flex-shrink: 0; }

.zoom-display {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600; color: #374151; padding: 0 2px;
}
.zoom-display input[type=number] {
  width: 48px; text-align: center; border: 1.5px solid #e2e8f0;
  border-radius: 6px; padding: 3px 4px; font-size: 12px;
  font-family: 'Vazirmatn', sans-serif; outline: none;
  -moz-appearance: textfield;
}
.zoom-display input[type=number]::-webkit-inner-spin-button,
.zoom-display input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
.zoom-display input[type=number]:focus { border-color: var(--primary); }

.designer-layout {
  display: flex; height: calc(100vh - var(--topbar-height) - var(--optionsbar-height));
  overflow: hidden;
}
/* left drawer (tools) — tab on physical-left, content to the right of tab */
.designer-sidebar-left {
  position: relative;
  width: 38px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid #e8ecf0;
  overflow: hidden;
  transition: width .22s ease;
}
.designer-sidebar-left.open { width: 280px; }
.tool-panel-tab {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 38px;
  border: none; background: #fff;
  border-right: 1px solid #e8ecf0;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 0;
  color: var(--primary);
  transition: background .15s;
  z-index: 2;
}
.tool-panel-tab:hover { background: #f0f4ff; }
.tool-panel-inner {
  position: absolute;
  top: 0; bottom: 0; left: 38px; right: 0;
  overflow-y: auto; overflow-x: hidden;
  direction: rtl;
}
.designer-canvas-area {
  flex: 1; background: #e8ecf4;
  display: flex; align-items: center; justify-content: center;
  overflow: auto; position: relative;
}
.designer-sidebar-right {
  position: relative;
  width: 38px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e8ecf0;
  overflow: hidden;
  transition: width .22s ease;
}
.designer-sidebar-right.open { width: 276px; }
.prop-panel-tab {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 38px;
  border: none; background: #fff;
  border-left: 1px solid #e8ecf0;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 0;
  color: var(--primary);
  transition: background .15s;
  z-index: 2;
}
.prop-panel-tab:hover { background: #f0f4ff; }
.prop-tab-label {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 11px; font-weight: 700;
  white-space: nowrap; letter-spacing: .5px;
}
.prop-panel-inner {
  position: absolute;
  top: 0; bottom: 0; right: 38px; left: 0;
  overflow-y: auto; overflow-x: hidden;
  direction: rtl;
}
.font-select {
  width: 100%; padding: 7px 10px; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: #fff;
  font-size: 13px; font-family: 'Vazirmatn', sans-serif;
  cursor: pointer; color: #374151;
}
.font-select:focus { border-color: var(--primary); outline: none; }

.tool-section { border-bottom: 1px solid #f0f2f5; }
.tool-section-header {
  padding: 14px 16px;
  font-size: 12px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: .5px;
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between;
  user-select: none;
}
.tool-section-header:hover { background: #f8fafc; }
.tool-section-body { padding: 12px 16px; }

.tool-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: #fff;
  cursor: pointer; transition: var(--transition);
  width: 100%; margin-bottom: 6px;
  font-family: 'Vazirmatn', sans-serif; font-size: 13px; color: #374151;
}
.tool-btn:hover { border-color: var(--primary); background: #eef1fd; color: var(--primary); }
.tool-btn .tool-btn-icon { width: 32px; height: 32px; border-radius: 8px; background: #f0f2f8; display: flex; align-items: center; justify-content: center; font-size: 15px; }

.canvas-wrap {
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.canvas-wrap.drag-over { outline: 3px dashed var(--primary); outline-offset: -3px; }
.placeholder-chip { cursor: grab; }
.placeholder-chip:active { cursor: grabbing; }
canvas { display: block; }

/* ── Preview info ── */
.preview-section-label {
  font-size: 11px; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 12px;
}
.preview-info-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px;
}
.preview-info-item { display: flex; flex-direction: column; gap: 3px; }
.preview-info-val { font-size: 14px; color: #1a1f36; font-weight: 500; }
.preview-divider { border: none; border-top: 1px solid #f0f2f5; margin: 18px 0; }

/* ── Navigator Panel ── */
.navigator-panel {
  position: fixed; bottom: 20px; left: 20px;
  width: 228px;
  background: #1a1f36;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  z-index: 600;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  display: none;
  user-select: none;
}
.navigator-panel.visible { display: block; }
.nav-header {
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600;
}
.nav-header-left { display: flex; align-items: center; gap: 6px; }
.nav-close {
  background: none; border: none; color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px;
  border-radius: 4px; transition: .15s;
}
.nav-close:hover { color: #fff; background: rgba(255,255,255,.1); }
.navigator-canvas-wrap {
  padding: 6px; background: #0d1b2a;
}
#navigatorCanvas {
  display: block; width: 216px; height: 150px;
  cursor: crosshair; border-radius: 4px; background: #0d1b2a;
}
.nav-zoom-row {
  padding: 7px 12px;
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.5); font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-zoom-row input[type=range] {
  flex: 1; height: 3px; cursor: pointer; accent-color: var(--primary);
  background: rgba(255,255,255,.15); border-radius: 2px; outline: none;
}
#navZoomPct {
  min-width: 36px; text-align: left; font-size: 11px; color: rgba(255,255,255,.6);
}

/* ── Filters ── */
.filter-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.filter-chip {
  padding: 7px 6px; border-radius: 8px;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
  cursor: pointer; font-family: 'Vazirmatn', sans-serif;
  font-size: 12px; color: #374151; text-align: center;
  transition: var(--transition); line-height: 1.3;
}
.filter-chip:hover { border-color: var(--primary); background: #eef1fd; color: var(--primary); }
.filter-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.filter-chip .filter-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  margin: 0 auto 4px; border: 1.5px solid rgba(0,0,0,.1);
}

/* keeps the old toolbar-btn base styles used in options bar */
.toolbar-btn {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #6b7280;
}
.toolbar-btn:hover { background: #f0f2f8; color: var(--primary); }
.toolbar-btn.active { background: #eef1fd; color: var(--primary); }
.toolbar-sep { width: 1px; height: 24px; background: #e8ecf0; margin: 0 4px; }

/* ── Properties Panel ── */
.prop-row { margin-bottom: 12px; }
.prop-label { font-size: 11px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.prop-input {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid #e2e8f0; border-radius: 6px;
  font-family: 'Vazirmatn', sans-serif; font-size: 13px;
  outline: none; transition: var(--transition);
}
.prop-input:focus { border-color: var(--primary); }
.prop-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; align-items: center; }
.page-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid #e2e8f0;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: var(--transition); color: #374151;
  text-decoration: none; font-weight: 600;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; pointer-events: none; transition: .3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal-box {
  background: #fff; border-radius: var(--radius);
  width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  transform: scale(.9); transition: .3s; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-overlay.show .modal-box { transform: scale(1); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid #f0f2f5;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h5 { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: #f0f2f8; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0f2f5; display: flex; gap: 10px; justify-content: flex-start; }

/* ── Print Preview ── */
.print-modal .modal-box { max-width: 900px; }
.paper-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.paper-option {
  border: 2px solid #e2e8f0; border-radius: 10px; padding: 16px 12px;
  text-align: center; cursor: pointer; transition: var(--transition);
}
.paper-option:hover, .paper-option.selected { border-color: var(--primary); background: #eef1fd; }
.paper-option .paper-icon { font-size: 32px; margin-bottom: 6px; }
.paper-option .paper-name { font-size: 14px; font-weight: 700; color: #374151; }
.paper-option .paper-size { font-size: 11px; color: #9ca3af; }

/* ── Print Styles ── */
@media print {
  .no-print { display: none !important; }
  .sidebar, .topbar, .page-content > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; width: 100%; margin: 0; }
  body { background: #fff; }
  .main-content { margin: 0; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(100%); transition: .3s; width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); --sidebar-width: 260px; }
  .main-content { margin-right: 0; }
  .page-content { padding: 16px; }
  .stat-card { flex-direction: column; text-align: center; }
  .designer-layout { flex-direction: column; }
  .designer-sidebar-left { width: 38px; }
  .designer-sidebar-left.open { width: 280px; }
  .designer-sidebar-right { width: 38px; }
  .designer-sidebar-right.open { width: 276px; }
  .topbar { padding: 0 12px; }
  .paper-options { grid-template-columns: 1fr; }

  .mobile-menu-btn {
    display: flex !important; width: 38px; height: 38px;
    align-items: center; justify-content: center;
    border-radius: 10px; border: 1.5px solid #e8ecf0;
    background: #fff; cursor: pointer; font-size: 18px; color: #374151;
  }
}
.mobile-menu-btn { display: none; }

/* ── Overlay for mobile sidebar ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a1f5e 50%, #2d1b69 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67,97,238,.2) 0%, transparent 70%);
  top: -200px; right: -200px;
}
.login-page::after {
  content: '';
  position: absolute; width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247,37,133,.15) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}
.login-box {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
}
.login-logo {
  width: 70px; height: 70px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; margin: 0 auto 20px;
}
.login-title { color: #fff; font-size: 22px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.login-sub { color: rgba(255,255,255,.5); font-size: 14px; text-align: center; margin-bottom: 32px; }
.login-box .form-control {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15);
  color: #fff; font-size: 14px;
}
.login-box .form-control::placeholder { color: rgba(255,255,255,.35); }
.login-box .form-label { color: rgba(255,255,255,.7); }
.login-box .form-control:focus {
  background: rgba(255,255,255,.12); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.2);
  color: #fff;
}

/* ── Toasts / Notifications ── */
.toast-container { position: fixed; top: 20px; left: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #fff; border-radius: 10px; padding: 14px 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  display: flex; align-items: center; gap: 12px;
  min-width: 280px; font-size: 14px;
  animation: slideIn .3s ease;
  border-right: 4px solid var(--success);
}
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Color dot picker ── */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 24px; height: 24px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: var(--transition);
}
.color-dot:hover, .color-dot.selected { border-color: #333; transform: scale(1.2); }

/* ── Font size control ── */
.number-input { display: flex; align-items: center; gap: 0; }
.number-input input { text-align: center; border-radius: 0; flex: 1; }
.number-input .num-btn {
  width: 32px; height: 38px; border: 1.5px solid #e2e8f0; background: #f8fafc;
  cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.number-input .num-btn:first-child { border-radius: 0 6px 6px 0; border-left: none; }
.number-input .num-btn:last-child { border-radius: 6px 0 0 6px; border-right: none; }
.number-input .num-btn:hover { background: #eef1fd; color: var(--primary); }
