/* ==========================================================================
   HANKAN CLEANING LLC - ADMIN CONTROL PANEL STYLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --admin-navy: #08265d;
  --admin-navy-dark: #051a42;
  --admin-sidebar: #072152;
  --admin-red: #ff073b;
  --admin-bg: #f4f7fc;
  --admin-card: #ffffff;
  --admin-border: #e2eaf4;
  --admin-text: #14233c;
  --admin-muted: #64748b;
  --admin-green: #0d8239;
  --admin-gold: #b9945b;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--admin-text);
  background-color: var(--admin-bg);
  font-size: 14.5px;
  line-height: 1.5;
}

a {
  color: var(--admin-navy);
  text-decoration: none;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.admin-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand img {
  width: 36px;
  height: 36px;
  filter: brightness(0) invert(1);
}

.admin-brand span {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.5px;
}

.admin-nav {
  padding: 20px 12px;
  list-style: none;
  flex: 1;
}

.admin-nav-item {
  margin-bottom: 4px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s;
}

.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.admin-nav-link.active {
  background: var(--admin-red);
  color: #fff;
}

.admin-nav-badge {
  margin-left: auto;
  background: rgba(255, 7, 59, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
}

.admin-user-box {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: #fff;
  height: 70px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.admin-content {
  padding: 32px;
  flex: 1;
}

/* Cards & Stats */
.admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(8, 38, 93, 0.04);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  color: var(--admin-navy);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(8, 38, 93, 0.03);
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--admin-navy);
  line-height: 1.1;
  margin-top: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--admin-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--admin-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* Tables */
.admin-table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: var(--admin-bg);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 14px;
  color: var(--admin-text);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: #fafcff;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-new { background: #fff8e6; color: #b47a00; border: 1px solid #ffe399; }
.status-reviewed { background: #eaf2fc; color: #08265d; border: 1px solid #c7dcf5; }
.status-quote_sent { background: #eaf2fc; color: #0d3885; border: 1px solid #bed6f4; }
.status-customer_confirmed { background: #e6f9ed; color: #0d8239; border: 1px solid #b3edc5; }
.status-confirmed { background: #08265d; color: #fff; border: 1px solid #08265d; }
.status-completed { background: #e6f9ed; color: #0d8239; }
.status-cancelled { background: #feecef; color: #ff073b; border: 1px solid #ffccd5; }
.status-rejected { background: #f1f5f9; color: #64748b; }

/* Buttons & Inputs */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-admin-primary {
  background: var(--admin-red);
  color: #fff;
  border-color: var(--admin-red);
}

.btn-admin-primary:hover {
  background: #e00030;
  color: #fff;
}

.btn-admin-navy {
  background: var(--admin-navy);
  color: #fff;
}

.btn-admin-navy:hover {
  background: #0d3885;
  color: #fff;
}

.btn-admin-outline {
  background: #fff;
  border-color: var(--admin-border);
  color: var(--admin-text);
}

.btn-admin-outline:hover {
  background: var(--admin-bg);
}

.btn-admin-danger {
  background: #feecef;
  color: var(--admin-red);
  border-color: #ffd0d8;
}

.btn-admin-danger:hover {
  background: var(--admin-red);
  color: #fff;
}

/* Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 26, 66, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal.active {
  display: flex;
}

.admin-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(8, 38, 93, 0.2);
}

.admin-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-body {
  padding: 24px;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Groups */
.form-group-admin {
  margin-bottom: 18px;
}

.form-group-admin label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-navy);
  margin-bottom: 6px;
}

.form-control-admin {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: #fff;
  color: var(--admin-text);
  font-family: inherit;
}

.form-control-admin:focus {
  outline: none;
  border-color: var(--admin-navy);
  box-shadow: 0 0 0 3px rgba(8, 38, 93, 0.1);
}

/* ==========================================================================
   RESPONSIVE & MOBILE DRAWER STYLES
   ========================================================================== */

/* Toggle Button in Topbar (Hidden on desktop) */
.admin-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: #fff;
  color: var(--admin-navy);
  font-size: 22px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.admin-sidebar-toggle:hover {
  background: var(--admin-bg);
  color: var(--admin-red);
}

/* Close Button inside Sidebar (Hidden on desktop) */
.admin-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-sidebar-close:hover {
  background: var(--admin-red);
}

/* Mobile Drawer Backdrop */
.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 26, 66, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.admin-sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Tablet & Mobile Screens (< 992px) */
@media (max-width: 991px) {
  .admin-layout {
    flex-direction: column;
    min-height: 100vh;
  }

  .admin-sidebar-toggle {
    display: inline-flex;
  }

  .admin-sidebar-close {
    display: inline-flex;
  }

  /* Off-canvas mobile sidebar drawer */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: -290px;
    bottom: 0;
    width: 280px;
    z-index: 1050;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }

  .admin-sidebar.active {
    left: 0;
  }

  .admin-main {
    width: 100%;
    min-width: 0;
  }

  .admin-topbar {
    padding: 0 16px;
    height: 62px;
  }

  .admin-topbar-title {
    font-size: 17px !important;
  }

  .admin-content {
    padding: 18px 14px;
  }

  .admin-card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 10px;
  }

  .admin-card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px;
  }

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

  .admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin: 0 -8px;
    padding: 0 8px;
  }

  .admin-table {
    min-width: 680px;
    font-size: 13px;
  }
}

/* Small Smartphone Screens (< 768px) */
@media (max-width: 767px) {
  /* Auto-collapse all multi-column inline grids to 1 column on phones */
  .admin-content div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .admin-topbar {
    padding: 0 12px;
  }

  .admin-topbar-title {
    font-size: 15px !important;
  }

  .admin-topbar-actions .btn-admin {
    padding: 7px 10px;
    font-size: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .admin-card-header h3 {
    font-size: 16px;
  }

  .btn-admin {
    font-size: 13px;
    padding: 9px 16px;
  }

  /* Ensure toolbars and inline buttons wrap gracefully */
  .admin-content div[style*="display:flex"]:not(.admin-table div),
  .admin-content div[style*="display: flex"]:not(.admin-table div) {
    flex-wrap: wrap !important;
  }

  /* Modals on mobile */
  .admin-modal-content {
    margin: 16px;
    max-height: 85vh;
  }

  /* Full width inputs on mobile */
  .admin-content form input[type="text"],
  .admin-content form input[type="email"],
  .admin-content form input[type="password"],
  .admin-content form input[type="date"],
  .admin-content form select {
    max-width: 100% !important;
  }
}

/* Screen utility helpers for admin layout */
@media (max-width: 575px) {
  .d-none { display: none !important; }
  .d-sm-inline { display: none !important; }
  .d-sm-block { display: none !important; }
}

@media (min-width: 576px) {
  .d-sm-inline { display: inline !important; }
  .d-sm-block { display: block !important; }
  .d-sm-none { display: none !important; }
}

