/* APaaS Assure — admin console chrome
   Loaded ON TOP of /assets/css/site.css so brand colors + .btn rules carry over.
   Console-specific: sidebar + topbar layout, data tables, KPI cards, forms.
*/

html, body { height: 100%; background: #F4F8FB; }

/* =================== LAYOUT =================== */
.console-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) { .console-layout { grid-template-columns: 1fr; } }

/* =================== SIDEBAR =================== */
.sidebar {
  background: #0D4071;
  color: #C9D4E2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #08274A;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid #1A5599;
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand img { height: 32px; width: auto; }
.sidebar-brand-text { color: #FFFFFF; font-weight: 600; font-size: 16px; }
.sidebar-brand-text .accent { color: #7CB342; }

.sidebar-section { padding: 18px 12px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: #7E92AE; font-weight: 600; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 14px;
  color: #C9D4E2;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav a:hover { background: #1A5599; color: #FFFFFF; text-decoration: none; }
.sidebar-nav a.active { background: #7CB342; color: #FFFFFF; font-weight: 500; }
.sidebar-nav a.active:hover { background: #689F38; }
.sidebar-nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }

.sidebar-footer { margin-top: auto; padding: 14px 16px; border-top: 1px solid #1A5599; display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #7CB342; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.sidebar-user-name { color: #FFFFFF; font-size: 13px; font-weight: 500; }
.sidebar-user-role { color: #7E92AE; font-size: 11px; }
.sidebar-logout { margin-left: auto; color: #7E92AE; font-size: 12px; }
.sidebar-logout:hover { color: #FFFFFF; text-decoration: none; }

/* =================== MAIN AREA =================== */
.console-main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #ECEFF3;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-size: 18px; font-weight: 600; color: #0D4071; margin: 0; }
.topbar-breadcrumb { font-size: 12px; color: #888780; margin-top: 2px; }
.topbar-search { margin-left: auto; position: relative; }
.topbar-search input {
  width: 280px;
  padding: 8px 14px 8px 34px;
  border: 1px solid #ECEFF3;
  border-radius: 6px;
  font-size: 13px;
  background: #F4F8FB;
  font-family: inherit;
  color: #1A2841;
}
.topbar-search input:focus { outline: 2px solid #7CB342; outline-offset: -1px; background: #FFFFFF; }
.topbar-search::before { content: "\1F50D"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #888780; }

.content-area { padding: 28px; flex: 1; }
.content-area > h1 { margin: 0 0 18px; font-size: 22px; color: #0D4071; }

.page-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.page-toolbar .toolbar-spacer { flex: 1; }

/* =================== KPI CARDS =================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card { background: #FFFFFF; border-radius: 10px; padding: 18px 20px; border: 1px solid #ECEFF3; border-left: 4px solid #0D4071; }
.kpi-card.kpi-green { border-left-color: #7CB342; }
.kpi-card.kpi-blue { border-left-color: #1E88E5; }
.kpi-card.kpi-amber { border-left-color: #E0A82E; }
.kpi-card.kpi-red { border-left-color: #A32D2D; }
.kpi-label { font-size: 12px; color: #888780; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; color: #0D4071; line-height: 1.1; }
.kpi-unit { font-size: 13px; color: #5C6B80; font-weight: 400; margin-left: 4px; }
.kpi-trend { font-size: 12px; color: #5C6B80; margin-top: 6px; }
.kpi-trend .trend-up { color: #7CB342; font-weight: 600; }
.kpi-trend .trend-down { color: #A32D2D; font-weight: 600; }

/* =================== PANELS =================== */
.panel { background: #FFFFFF; border-radius: 10px; border: 1px solid #ECEFF3; margin-bottom: 20px; }
.panel-head { padding: 16px 20px; border-bottom: 1px solid #ECEFF3; display: flex; align-items: center; gap: 10px; }
.panel-title { font-size: 15px; font-weight: 600; color: #0D4071; margin: 0; }
.panel-sub { font-size: 12px; color: #888780; margin: 0; }
.panel-body { padding: 16px 20px; }
.panel-body.no-pad { padding: 0; }
.panel-spacer { flex: 1; }

/* =================== DATA TABLES =================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { text-align: left; padding: 12px 16px; background: #F4F8FB; font-weight: 600; color: #0D4071; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid #ECEFF3; white-space: nowrap; }
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid #ECEFF3; color: #1A2841; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #F8FBFD; cursor: pointer; }
.data-table tbody tr.no-click { cursor: default; }
.data-table tbody tr.no-click:hover { background: transparent; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .muted { color: #888780; }
.data-table .strong { font-weight: 600; color: #0D4071; }

/* Row logo cell */
.row-with-logo { display: flex; align-items: center; gap: 10px; }
.row-logo { width: 32px; height: 32px; border-radius: 6px; background: #F4F8FB; color: #0D4071; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; flex-shrink: 0; border: 1px solid #ECEFF3; }
.row-logo-green { background: #E8F5E9; color: #33691E; border-color: #C8E6C9; }
.row-logo-blue { background: #E3F2FD; color: #0D47A1; border-color: #BBDEFB; }

/* =================== PILLS / CHIPS =================== */
.pill { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.2px; }
.pill-green { background: #E8F5E9; color: #33691E; }
.pill-blue { background: #E3F2FD; color: #0D47A1; }
.pill-amber { background: #FFF3E0; color: #BF6F00; }
.pill-red { background: #FFEBEE; color: #A32D2D; }
.pill-grey { background: #ECEFF3; color: #5C6B80; }
.pill-navy { background: #E3EAF3; color: #0D4071; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 14px; font-size: 12px; background: #FFFFFF; color: #5C6B80; border: 1px solid #ECEFF3; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.chip:hover { background: #F4F8FB; color: #1A2841; }
.chip.active { background: #0D4071; color: #FFFFFF; border-color: #0D4071; }
.chip.active:hover { background: #08274A; }

/* =================== FORMS =================== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: #5C6B80; margin-bottom: 5px; font-weight: 500; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ECEFF3;
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
  background: #FFFFFF;
  color: #1A2841;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: 2px solid #7CB342; outline-offset: -1px; border-color: transparent; }
.form-help { font-size: 11.5px; color: #888780; margin-top: 4px; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { padding: 7px 10px; font-size: 13px; }

/* =================== LOGIN =================== */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #F4F8FB 0%, #E3F2FD 100%); }
.login-card { background: #FFFFFF; border-radius: 14px; padding: 38px 40px; width: 100%; max-width: 400px; box-shadow: 0 12px 36px rgba(13, 64, 113, 0.10); border: 1px solid #ECEFF3; }
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 24px; }
.login-brand img { height: 38px; width: auto; }
.login-brand-text { font-size: 17px; font-weight: 600; color: #0D4071; }
.login-brand-text .accent { color: #7CB342; }
.login-title { text-align: center; font-size: 18px; color: #0D4071; margin: 0 0 6px; }
.login-sub { text-align: center; font-size: 13px; color: #5C6B80; margin: 0 0 22px; }
.login-sso { width: 100%; padding: 10px 14px; border: 1px solid #ECEFF3; background: #FFFFFF; color: #1A2841; font-size: 13.5px; font-weight: 500; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: inherit; }
.login-sso:hover { background: #F4F8FB; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #888780; font-size: 11.5px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: #ECEFF3; }
.login-submit { width: 100%; padding: 11px 14px; margin-top: 4px; }
.login-foot { text-align: center; font-size: 12px; color: #5C6B80; margin-top: 18px; }
.login-foot a { color: #1E88E5; }

/* =================== TABS =================== */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid #ECEFF3; margin-bottom: 20px; }
.tabbar a { padding: 10px 16px; font-size: 13.5px; color: #5C6B80; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabbar a:hover { color: #0D4071; text-decoration: none; }
.tabbar a.active { color: #0D4071; border-bottom-color: #7CB342; font-weight: 600; }

/* =================== DETAIL HEADER =================== */
.detail-head { background: #FFFFFF; border: 1px solid #ECEFF3; border-radius: 10px; padding: 22px 24px; margin-bottom: 20px; display: flex; align-items: center; gap: 18px; }
.detail-head-logo { width: 56px; height: 56px; border-radius: 10px; background: #F4F8FB; color: #0D4071; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; border: 1px solid #ECEFF3; flex-shrink: 0; }
.detail-head-text h1 { font-size: 22px; color: #0D4071; margin: 0 0 4px; }
.detail-head-meta { font-size: 13px; color: #5C6B80; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-head-actions { margin-left: auto; display: flex; gap: 8px; }

/* =================== GRID HELPERS =================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* =================== ACTIVITY FEED =================== */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #ECEFF3; font-size: 13px; }
.activity-list li:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #7CB342; margin-top: 8px; flex-shrink: 0; }
.activity-dot.dot-blue { background: #1E88E5; }
.activity-dot.dot-amber { background: #E0A82E; }
.activity-dot.dot-red { background: #A32D2D; }
.activity-body { flex: 1; }
.activity-when { font-size: 11.5px; color: #888780; }
.activity-text { color: #1A2841; }
.activity-text strong { color: #0D4071; }

/* =================== INLINE COST EDIT =================== */
.cost-edit { display: inline-flex; align-items: center; gap: 4px; }
.cost-edit input { width: 90px; padding: 5px 8px; font-size: 12.5px; border: 1px solid #ECEFF3; border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; font-family: inherit; color: #1A2841; background: #F4F8FB; }
.cost-edit input:focus { outline: 2px solid #7CB342; outline-offset: -1px; background: #FFFFFF; }
.cost-source { font-size: 10.5px; color: #888780; }
.cost-source.rrp { color: #1E88E5; }
.cost-source.contract { color: #7CB342; font-weight: 600; }

/* =================== SAVINGS HIGHLIGHTING =================== */
.savings-strong { color: #7CB342; font-weight: 700; }
.savings-mild { color: #BF6F00; font-weight: 600; }
.savings-none { color: #888780; }
