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

:root {
  --primary-orange: #f35c05;
  --primary-orange-hover: #d64c00;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #dbe1ea;
  --surface: #ffffff;
  --page: #fdf5f0;
  --danger: #c24136;
  --warning-bg: #fff2eb;
  --warning-border: #ffd3bd;
  --warning-text: #d84e00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Inter', "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  min-height: 100vh;
  background: #fdf5f0;
}

/* Left panel with background image */
.brand-panel {
  background-image: url('assets/background-login.png');
  background-size: cover;
  background-position: 30% center;
  background-repeat: no-repeat;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 40px 60px 40px 40px;
}

.charts-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 320px;
}

.chart-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Right panel with rounded corner overlapping */
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  background: #ffffff;
  border-top-left-radius: 40px;
  border-bottom-left-radius: 40px;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 10;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

/* Brand Header */
.brand-header {
  text-align: center;
}
.brand-header .brand-logo-img {
    width: 100%;
    max-width: 360px;
    height: auto;
}
.brand-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.5px;
}

.brand-year {
  color: var(--primary-orange);
  font-weight: 700;
}

/* Login Header */
.login-card header {
  margin-bottom: 24px;
}

.sso-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary-orange);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-card h2 {
  margin: 0 0 10px;
  color: #1f2937;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.login-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Form Styles */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap:focus-within {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 4px rgba(243, 92, 5, 0.12);
}

.input-wrap svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #9ca3af;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

input::placeholder {
  color: #9ca3af;
}

.field-error {
  min-height: 18px;
  margin: 6px 0 16px;
  color: var(--danger);
  font-size: 13px;
}

/* Primary Button */
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--primary-orange);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--primary-orange-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.8;
}

.primary-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* Alert styling */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.alert-warning, .alert-danger {
  background-color: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.alert-icon {
  width: 20px;
  height: 20px;
  color: var(--primary-orange);
  flex-shrink: 0;
}

.alert-success .alert-icon {
  color: #16a34a;
}

/* Responsive Queries */
@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .login-panel {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 32px 20px;
    background: #ffffff;
  }

  .login-card {
    max-width: 360px;
  }

  .brand-header {
    margin-bottom: 24px;
  }
  
  .brand-header .brand-logo-img {
    max-width: 260px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 6px;
  }

  .brand-title {
    font-size: 19px;
  }

  .login-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .sso-eyebrow {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .alert {
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
  }

  .alert-icon {
    width: 18px;
    height: 18px;
  }

  .input-wrap {
    height: 44px;
    border-radius: 6px;
  }

  .primary-button {
    height: 44px;
    border-radius: 6px;
    font-size: 14px;
  }

  .field-error {
    min-height: 16px;
    margin: 4px 0 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .charts-container {
    display: none;
  }
}

/* Sidebar Styles */
.app-container {
  display: flex;
  min-height: 100vh;
  background: #fdf5f0;
}

.hamburger-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1001;
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  padding: 6px;
  border: none;
  background: var(--primary-orange);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hamburger-btn:hover {
  background: var(--primary-orange-hover);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-toggle-main {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1002;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--primary-orange);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-toggle-main.visible {
  display: flex;
}

.sidebar-toggle-main:hover {
  background: var(--primary-orange-hover);
}

.sidebar-toggle-main i {
  color: #fff;
  font-size: 20px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fff;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn span {
  opacity: 0;
  visibility: hidden;
  position: absolute;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 20px 10px;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .nav-link i {
  margin-right: 0;
}

.sidebar.collapsed .user-info {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .user-details {
  display: none;
}

.sidebar.collapsed .logout-btn {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .logout-btn span {
  display: none;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar.hidden + .main-content {
  margin-left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.sidebar-header .brand-logo {
  flex-shrink: 0;
}

.brand-logo-img {
  width: 180px;
  height: auto;
  flex-shrink: 0;
}

.sidebar-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background: #f3f4f6;
  color: var(--primary-orange);
}

.sidebar-toggle-btn i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.sidebar-header .brand-title {
  font-size: 18px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: #fff3ed;
  color: var(--primary-orange);
}

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

.nav-link i {
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--line);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8f9fa;
  margin-bottom: 12px;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-orange);
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #fee2e2;
  color: #dc2626;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.logout-btn:hover {
  background: #fecaca;
}

.logout-btn i {
  font-size: 18px;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
  margin-left: 70px;
}

/* Responsive Sidebar */
@media (max-width: 992px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 260px;
  }

  .sidebar.collapsed .brand-title,
  .sidebar.collapsed .nav-link span,
  .sidebar.collapsed .user-details,
  .sidebar.collapsed .logout-btn span {
    opacity: 1;
    visibility: visible;
    position: static;
  }

  .sidebar.collapsed .sidebar-header {
    justify-content: flex-start;
    padding: 24px 20px;
  }

  .sidebar.collapsed .nav-link {
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .sidebar.collapsed .nav-link i {
    margin-right: 12px;
  }

  .sidebar.collapsed .user-info {
    justify-content: flex-start;
    padding: 12px;
  }

  .sidebar.collapsed .user-details {
    display: block;
  }

  .sidebar.collapsed .logout-btn {
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .sidebar.collapsed .logout-btn span {
    display: inline;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar.collapsed + .main-content {
    margin-left: 0;
  }
}

@media (max-width: 576px) {
  .sidebar {
    width: 280px;
  }

  .hamburger-btn {
    top: 12px;
    left: 12px;
  }
}
