:root{--sidebar:#111827;--sidebar2:#1f2937;--accent:#0d6efd;--bg:#f4f7fb;--card:#ffffff;--border:#e5e7eb;}
body{background:var(--bg);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#111827;}
.admin-shell{display:flex;min-height:100vh;background:var(--bg);}
.admin-sidebar{width:280px;background:linear-gradient(180deg,var(--sidebar),var(--sidebar2));color:#fff;position:fixed;inset:0 auto 0 0;overflow-y:auto;z-index:20;box-shadow:0 10px 30px rgba(15,23,42,.25);}
.admin-main{margin-left:280px;min-height:100vh;width:calc(100% - 280px);}
.brand-box{display:flex;gap:12px;align-items:center;padding:22px 20px;border-bottom:1px solid rgba(255,255,255,.08);}
.brand-icon{width:44px;height:44px;border-radius:14px;background:rgba(13,110,253,.95);display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 10px 20px rgba(13,110,253,.25);}
.brand-title{font-size:18px;font-weight:800;letter-spacing:.2px;line-height:1.1}.brand-subtitle{font-size:12px;color:rgba(255,255,255,.62)}
.user-box{display:flex;gap:12px;align-items:center;padding:16px 20px;background:rgba(255,255,255,.06);margin:16px;border-radius:16px;}
.user-avatar{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.15);display:flex;align-items:center;justify-content:center;font-size:20px;}
.sidebar-nav{padding:0 12px 24px}.nav-link-custom{display:flex;align-items:center;gap:12px;color:rgba(255,255,255,.78);text-decoration:none;padding:12px 14px;border-radius:12px;margin-bottom:4px;font-weight:600;font-size:14px;transition:.15s;}
.nav-link-custom:hover{background:rgba(255,255,255,.1);color:#fff}.nav-link-custom md-icon{color:inherit;font-size:20px;width:20px;height:20px;}
.submenu{padding:0 0 8px 46px}.submenu a{display:block;color:rgba(255,255,255,.62);text-decoration:none;padding:7px 8px;border-radius:8px;font-size:13px}.submenu a:hover{color:#fff;background:rgba(255,255,255,.08)}
.admin-topbar{height:auto;min-height:86px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 26px;position:sticky;top:0;z-index:10;}
.page-title{font-size:24px;line-height:1.1;margin:0;font-weight:800}.topbar-actions{display:flex;align-items:center;gap:10px}.search-box{min-width:360px}.content-wrap{padding:26px;}
.login-wrap{min-height:100vh;background:radial-gradient(circle at top left,#dbeafe,#f8fafc 42%,#eef2ff);display:flex;align-items:center;justify-content:center;padding:20px;}
.card,.md-whiteframe-1dp,md-card{border:0!important;border-radius:18px!important;box-shadow:0 10px 30px rgba(15,23,42,.08)!important;background:#fff!important;overflow:hidden;}
.table{margin-bottom:0}.table thead th{background:#f8fafc;border-bottom:1px solid #e5e7eb;color:#475569;text-transform:uppercase;font-size:12px;letter-spacing:.04em}.table td{vertical-align:middle;border-color:#eef2f7}.table-hover tbody tr:hover{background:#f8fbff}.table-responsive-vertical{border-radius:16px;overflow:hidden;border:1px solid #eef2f7;background:#fff}.btn-icon{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0;border-radius:10px}.form-control,.form-select{border-radius:12px;border-color:#d8dee8;padding:.72rem .9rem}.form-control:focus,.form-select:focus{box-shadow:0 0 0 .2rem rgba(13,110,253,.12)}.form-label{font-weight:700;color:#334155}.fieldset-card{border:1px solid #e5e7eb;border-radius:16px;padding:18px;background:#fbfdff}.red-alert{color:#dc3545;font-size:.875rem;margin-top:.35rem}.hint{font-size:.85rem;color:#64748b}.ta-toolbar{background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px 12px 0 0;padding:8px}.ta-editor{border:1px solid #e5e7eb;border-radius:0 0 12px 12px;padding:12px;min-height:180px;background:#fff}.md-btn-small{min-width:0!important;margin:0 2px!important}.md-ic-small{font-size:18px!important}.bootstrap-action-btn{border:1px solid #e5e7eb;background:#fff;border-radius:10px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:#334155}.bootstrap-action-btn:hover{background:#f8fafc;color:#0d6efd}
cl-paging{display:flex;justify-content:center;padding:18px}.pagination{margin:0!important}
@media(max-width:992px){.admin-sidebar{position:relative;width:100%;height:auto}.admin-shell{display:block}.admin-main{margin-left:0;width:100%}.admin-topbar{flex-direction:column;align-items:flex-start}.topbar-actions{flex-wrap:wrap}.search-box{min-width:260px}.content-wrap{padding:16px}}


/* Fix long admin forms: allow the page/content area to scroll */
html, body { height: 100%; overflow-y: auto !important; overflow-x: hidden; }
.admin-shell { min-height: 100vh; }
.admin-main { height: 100vh; overflow-y: auto; overflow-x: hidden; }
.content-wrap { padding-bottom: 120px; }

/* Keep sidebar labels left-aligned next to their icons */
.nav-link-custom span { margin-left: 0; text-align: left; flex: 1; }
.submenu { padding-left: 46px; padding-right: 0; text-align: left; }
.submenu a { text-align: left; }

.category-edit-form{border:1px solid #e5e7eb;border-radius:16px;padding:18px;background:#fbfdff;}
.category-cover-upload{display:flex;gap:16px;align-items:center;border:1px dashed #cbd5e1;border-radius:16px;padding:14px;background:#fff;}
.cover-preview{width:180px;height:104px;border-radius:14px;background:#f1f5f9;display:flex;align-items:center;justify-content:center;overflow:hidden;flex:0 0 auto;color:#64748b;}
.cover-preview img{width:100%;height:100%;object-fit:cover;display:block;}
.cover-empty{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;}
.cover-empty i{font-size:28px;}
.cover-actions{flex:1;min-width:0;}

/* v1.5 Scrollbar hotfix: use the browser/page scrollbar instead of an inner hidden container */
html,
body {
  min-height: 100% !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body {
  position: relative !important;
}

.admin-shell {
  min-height: 100vh !important;
  height: auto !important;
  overflow: visible !important;
}

.admin-main {
  margin-left: 280px;
  width: calc(100% - 280px);
  min-height: 100vh !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.content-wrap {
  min-height: calc(100vh - 86px);
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 180px !important;
}

.content-wrap > div,
[ng-view],
.ng-scope,
.card,
md-card,
md-content {
  max-height: none !important;
}

/* Keep the sidebar independently scrollable when menu items exceed screen height */
.admin-sidebar {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow-y: auto !important;
}

/* Mobile layout scroll fix */
@media(max-width: 992px){
  .admin-sidebar {
    position: relative !important;
    height: auto !important;
    max-height: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .category-cover-upload {
    align-items: stretch;
    flex-direction: column;
  }
  .cover-preview {
    width: 100%;
    height: 180px;
  }
}
