/* =====================================================
   GESTOR DE REFEIÇÕES - Sistema de Gestão de Refeições
   Pacaembu Construtora | 2026
   Paleta: Azul corporativo #1B3A6B, Verde #2E7D32,
           Cinza profissional #F5F6FA, Laranja #E65100
   ===================================================== */

:root {
  --primary: #1B3A6B;
  --primary-light: #2A5298;
  --primary-dark: #0F2144;
  --secondary: #2E7D32;
  --secondary-light: #43A047;
  --accent: #E65100;
  --accent-light: #FF6D00;
  --warning: #F9A825;
  --danger: #C62828;
  --info: #0277BD;
  --purple: #6A1B9A;
  --teal: #00695C;
  --indigo: #283593;

  --bg: #F5F6FA;
  --bg-dark: #EBEDF5;
  --white: #FFFFFF;
  --text: #1A1D2E;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E2E8F0;
  --border-dark: #CBD5E0;

  --sidebar-w: 260px;
  --header-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);

  --transition: all 0.25s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }
.hidden { display: none !important; }

/* === SPLASH SCREEN === */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center;
  animation: splashFade 0.5s ease 2.5s forwards;
}
@keyframes splashFade { to { opacity: 0; pointer-events: none; } }
.splash-content { text-align: center; color: white; }
.splash-logo { display: flex; align-items: center; gap: 14px; justify-content: center; margin-bottom: 16px; }
.splash-logo-icon { width: auto; height: auto; }
.splash-logo-icon svg { display: block; }
.splash-brand { font-size: 28px; font-weight: 800; letter-spacing: 3px; display: block; }
.splash-sub { font-size: 11px; font-weight: 400; letter-spacing: 2px; opacity: 0.8; display: block; }
.splash-app-name { font-size: 42px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -1px; }
.splash-desc { font-size: 16px; opacity: 0.8; margin-bottom: 40px; }
.splash-loader { width: 200px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; margin: 0 auto; }
.splash-loader-bar { height: 100%; background: white; border-radius: 4px; animation: loadBar 2.2s ease forwards; }
@keyframes loadBar { from { width: 0; } to { width: 100%; } }

/* === LOGIN PAGE === */
.login-container {
  min-height: 100vh; display: flex;
}
.login-left {
  flex: 1; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center; padding: 60px 50px;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,0.05); top: -100px; right: -100px;
}
.login-left::after {
  content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.05); bottom: -80px; left: -80px;
}
.login-left-content { max-width: 420px; color: white; position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.login-logo-icon { width: auto; height: auto; }
.login-brand { font-size: 22px; font-weight: 800; letter-spacing: 2px; display: block; }
.login-brand-sub { font-size: 10px; letter-spacing: 2px; opacity: 0.75; display: block; }
.login-headline { font-size: 36px; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.login-tagline { font-size: 16px; opacity: 0.8; margin-bottom: 36px; line-height: 1.7; }
.login-features { display: flex; flex-direction: column; gap: 12px; }
.login-feature { display: flex; align-items: center; gap: 10px; font-size: 14px; opacity: 0.9; }
.login-feature i { color: #4CAF50; font-size: 16px; }

.login-right {
  width: 480px; background: white; display: flex; align-items: center; justify-content: center; padding: 60px 50px;
}
.login-form-container { width: 100%; max-width: 360px; }
.login-form-header { margin-bottom: 32px; }
.login-form-header h2 { font-size: 28px; font-weight: 800; color: var(--text); }
.login-form-header p { color: var(--text-muted); margin-top: 4px; }
.form-remember { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); cursor: pointer; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.back-btn-wrap { margin-bottom: 20px; }

.login-demo-accounts { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.demo-title { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-btn {
  padding: 8px 12px; font-size: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; gap: 6px; transition: var(--transition);
}
.demo-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: white; transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
.form-input.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(198,40,40,0.1); }
.form-input.success { border-color: var(--secondary); }
.form-textarea { resize: vertical; min-height: 100px; }
.input-password { position: relative; }
.input-password .form-input { padding-right: 44px; }
.toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; cursor: pointer; background: none; border: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.form-section-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; padding-top: 20px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  transition: var(--transition); cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(27,58,107,0.3); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: var(--secondary-light); }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-success { background: var(--secondary); color: white; }
.btn-success:hover { background: var(--secondary-light); }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-warning:hover { background: #f57f17; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 13px 20px; font-size: 15px; }

/* === SIDEBAR === */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex; flex-direction: column; z-index: 300; transition: transform 0.3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}
.sidebar-header {
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo { display: flex; align-items: center; gap: 0; }
.sidebar-logo svg { display: block; flex-shrink: 0; }
.sidebar-brand span { display: block; font-size: 14px; font-weight: 800; color: white; letter-spacing: 1px; }
.sidebar-brand small { font-size: 10px; color: rgba(255,255,255,0.6); letter-spacing: 0.5px; }
.sidebar-close { color: rgba(255,255,255,0.6); font-size: 18px; display: none; }
.sidebar-close:hover { color: white; }

.sidebar-user {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 8px;
}
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2);
  color: white; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.sidebar-user-name { font-size: 13px; font-weight: 600; color: white; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.6); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.nav-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.4); padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: rgba(255,255,255,0.75); font-size: 14px;
  margin-bottom: 2px; transition: var(--transition); position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.15); color: white; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: #4CAF50; border-radius: 0 2px 2px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logout {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7); font-size: 14px; display: flex; align-items: center; gap: 8px;
  transition: var(--transition);
}
.sidebar-logout:hover { background: rgba(255,255,255,0.1); color: white; }
.sidebar-version { font-size: 10px; color: rgba(255,255,255,0.3); margin-top: 8px; text-align: center; }

.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 299; display: none;
}

/* === MAIN LAYOUT === */
.main-wrapper {
  margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.3s ease;
}

/* === HEADER === */
.top-header {
  height: var(--header-h); background: white; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle { color: var(--text-muted); font-size: 20px; display: none; }
.menu-toggle:hover { color: var(--primary); }
.header-breadcrumb { font-size: 15px; font-weight: 600; color: var(--text); }
.header-right { display: flex; align-items: center; gap: 12px; position: relative; }
.obra-select {
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); background: var(--bg); cursor: pointer;
  max-width: 200px;
}
.header-notif-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--bg);
  color: var(--text-muted); font-size: 17px; display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.header-notif-btn:hover { background: var(--primary); color: white; }
.notif-count {
  position: absolute; top: 2px; right: 2px; background: var(--danger); color: white;
  font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 10px; min-width: 16px; text-align: center;
}
.notif-count.zero { display: none; }
.header-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px;
  border-radius: var(--radius-sm); transition: var(--transition);
}
.header-user:hover { background: var(--bg); }
.header-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  color: white; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.header-user-name { font-size: 14px; font-weight: 600; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: white; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); z-index: 500; overflow: hidden;
}
.user-dropdown-header { padding: 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.ud-name { font-weight: 700; font-size: 14px; }
.ud-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ud-role { margin-top: 6px; }
.user-dropdown-items button {
  width: 100%; text-align: left; padding: 12px 16px; font-size: 14px;
  color: var(--text); display: flex; align-items: center; gap: 10px; transition: var(--transition);
}
.user-dropdown-items button:hover { background: var(--bg); }

/* === NOTIFICATIONS PANEL === */
.notif-panel {
  position: fixed; top: var(--header-h); right: 0; width: 360px; max-height: 500px;
  background: white; border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  z-index: 400; display: flex; flex-direction: column; overflow: hidden;
}
.notif-panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px;
}
.notif-panel-header button { font-size: 12px; color: var(--primary); background: none; border: none; cursor: pointer; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px;
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(27,58,107,0.04); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.notif-icon.info { background: rgba(2,119,189,0.1); color: var(--info); }
.notif-icon.success { background: rgba(46,125,50,0.1); color: var(--secondary); }
.notif-icon.warning { background: rgba(249,168,37,0.1); color: var(--warning); }
.notif-icon.error { background: rgba(198,40,40,0.1); color: var(--danger); }
.notif-content .notif-title { font-size: 13px; font-weight: 600; }
.notif-content .notif-msg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-content .notif-time { font-size: 10px; color: var(--text-light); margin-top: 4px; }

/* === CONTENT AREA === */
.content-area { flex: 1; padding: 28px; max-width: 1400px; }
.page-content { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title-main { font-size: 26px; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* === CARDS === */
.card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.card-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* === KPI CARDS === */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-card {
  background: white; border-radius: var(--radius); padding: 20px; display: flex;
  align-items: center; gap: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.kpi-blue::before { background: var(--primary); }
.kpi-orange::before { background: var(--accent); }
.kpi-green::before { background: var(--secondary); }
.kpi-red::before { background: var(--danger); }
.kpi-purple::before { background: var(--purple); }
.kpi-teal::before { background: var(--teal); }
.kpi-indigo::before { background: var(--indigo); }

.kpi-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.kpi-blue .kpi-icon { background: rgba(27,58,107,0.1); color: var(--primary); }
.kpi-orange .kpi-icon { background: rgba(230,81,0,0.1); color: var(--accent); }
.kpi-green .kpi-icon { background: rgba(46,125,50,0.1); color: var(--secondary); }
.kpi-red .kpi-icon { background: rgba(198,40,40,0.1); color: var(--danger); }
.kpi-purple .kpi-icon { background: rgba(106,27,154,0.1); color: var(--purple); }
.kpi-teal .kpi-icon { background: rgba(0,105,92,0.1); color: var(--teal); }
.kpi-indigo .kpi-icon { background: rgba(40,53,147,0.1); color: var(--indigo); }

.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* === DASHBOARD GRID === */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-card .card-header { padding: 16px 20px 12px; }
.chart-container { padding: 12px 16px 16px; }

/* === QUICK ACTIONS === */
.quick-actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.quick-action-btn {
  background: white; border-radius: var(--radius); padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  box-shadow: var(--shadow); transition: var(--transition); position: relative;
}
.quick-action-btn:hover { background: var(--primary); color: white; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action-btn i { font-size: 24px; color: var(--primary); }
.quick-action-btn:hover i { color: white; }
.quick-action-btn span { font-size: 13px; font-weight: 600; }
.qa-badge {
  position: absolute; top: 8px; right: 8px; background: var(--danger); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

/* === TABLES === */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
  background: var(--bg); border-bottom: 2px solid var(--border);
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: rgba(27,58,107,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* === STATUS BADGES === */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-rascunho { background: #F3F4F6; color: #6B7280; }
.status-enviado { background: rgba(2,119,189,0.1); color: var(--info); }
.status-validado { background: rgba(249,168,37,0.15); color: #E65100; }
.status-confirmado { background: rgba(46,125,50,0.1); color: var(--secondary); }
.status-entregue { background: rgba(27,58,107,0.1); color: var(--primary); }
.status-finalizado { background: #F3F4F6; color: #374151; }
.status-rejeitado { background: rgba(198,40,40,0.1); color: var(--danger); }

/* === ROLE BADGES === */
.role-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
}
.role-admin { background: rgba(106,27,154,0.1); color: var(--purple); }
.role-gerente { background: rgba(27,58,107,0.1); color: var(--primary); }
.role-validador { background: rgba(0,105,92,0.1); color: var(--teal); }
.role-solicitante { background: rgba(230,81,0,0.1); color: var(--accent); }
.role-restaurante { background: rgba(46,125,50,0.1); color: var(--secondary); }

/* === MEAL TYPE ICONS === */
.meal-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }

/* === FILTERS BAR === */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: flex-end; }
.filter-group { flex: 1; min-width: 160px; }
.filter-group .form-input { margin: 0; }
.result-count { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* === VALIDATION CARDS === */
.validation-list { display: flex; flex-direction: column; gap: 16px; }
.validation-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: var(--transition);
}
.validation-card:hover { box-shadow: var(--shadow-md); }
.validation-card-header {
  padding: 16px 20px; background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.validation-card-body { padding: 20px; }
.validation-card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.validation-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.validation-info-item label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; display: block; margin-bottom: 3px; }
.validation-info-item span { font-size: 14px; font-weight: 600; }
.val-order-id { font-size: 12px; color: var(--text-muted); }

/* === ORDER FORM LAYOUT === */
.order-form-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.order-form-card { padding: 24px; }
.qty-input-wrap { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--bg);
  border: 1.5px solid var(--border); color: var(--text); font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.qty-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.qty-input { text-align: center; max-width: 100px; }
.qty-limits { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.info-badge { padding: 10px 14px; background: var(--bg); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); border: 1.5px solid var(--border); }
.order-info-panel { display: flex; flex-direction: column; gap: 16px; }
.order-info-items { padding: 16px; }
.info-item { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.info-item:last-child { border-bottom: none; }
.info-item-label { font-size: 12px; color: var(--text-muted); }
.info-item-value { font-size: 14px; font-weight: 600; }

.file-upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 32px;
  text-align: center; cursor: pointer; transition: var(--transition); color: var(--text-muted);
}
.file-upload-area:hover { border-color: var(--primary); background: rgba(27,58,107,0.03); color: var(--primary); }
.file-upload-area i { font-size: 32px; margin-bottom: 8px; display: block; }
.file-preview { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); margin-top: 8px; font-size: 13px; }

/* === LAST ORDERS LIST === */
.last-order-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.last-order-item:hover { background: var(--bg); }
.last-order-item:last-child { border-bottom: none; }
.last-order-item-top { display: flex; justify-content: space-between; align-items: center; }
.last-order-item-title { font-size: 13px; font-weight: 600; }
.last-order-item-date { font-size: 11px; color: var(--text-muted); }

/* === ALERTS === */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-error { background: rgba(198,40,40,0.1); color: var(--danger); border: 1px solid rgba(198,40,40,0.2); }
.alert-success { background: rgba(46,125,50,0.1); color: var(--secondary); border: 1px solid rgba(46,125,50,0.2); }
.alert-warning { background: rgba(249,168,37,0.1); color: #E65100; border: 1px solid rgba(249,168,37,0.3); }
.alert-info { background: rgba(2,119,189,0.1); color: var(--info); border: 1px solid rgba(2,119,189,0.2); }

/* === PAGINATION === */
.pagination { padding: 16px 20px; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.page-btn {
  min-width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); background: white; color: var(--text); transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* === REPORTS === */
.report-filters { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

/* === AUDIT TIMELINE === */
.audit-timeline { padding: 20px; }
.audit-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.audit-item:last-child { border-bottom: none; }
.audit-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.audit-dot.create { background: rgba(46,125,50,0.1); color: var(--secondary); }
.audit-dot.update { background: rgba(249,168,37,0.1); color: var(--warning); }
.audit-dot.validate { background: rgba(2,119,189,0.1); color: var(--info); }
.audit-dot.reject { background: rgba(198,40,40,0.1); color: var(--danger); }
.audit-dot.confirm { background: rgba(27,58,107,0.1); color: var(--primary); }
.audit-dot.login { background: rgba(106,27,154,0.1); color: var(--purple); }
.audit-action { font-size: 14px; font-weight: 600; }
.audit-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.audit-detail { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* === ADMIN OBRAS GRID === */
.obras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.obra-card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: var(--transition);
}
.obra-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.obra-card-top { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); padding: 20px; color: white; }
.obra-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.obra-card-city { font-size: 13px; opacity: 0.8; }
.obra-card-body { padding: 16px 20px; }
.obra-card-stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.obra-card-stat:last-child { border-bottom: none; }
.obra-card-stat span:first-child { color: var(--text-muted); }
.obra-card-stat span:last-child { font-weight: 600; }
.obra-card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* === CONFIG PANEL === */
.config-obra-select-wrap { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.config-grid .card { padding: 20px; margin-bottom: 0; }
.toggle-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-item:last-child { border-bottom: none; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* === PROFILE === */
.profile-card { padding: 32px; }
.profile-avatar-area { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--primary); color: white; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-field label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; display: block; margin-bottom: 4px; }
.profile-field span { font-size: 15px; font-weight: 500; }

/* === MODALS === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 20px; animation: fadeIn 0.2s ease;
}
.modal {
  background: white; border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-large { max-width: 800px; }
.modal-sm { max-width: 400px; }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: white; z-index: 1;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { color: var(--text-muted); font-size: 18px; transition: var(--transition); }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: white;
}

/* === ORDER DETAIL MODAL === */
.order-detail-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.order-detail-section:last-child { border-bottom: none; margin-bottom: 0; }
.order-detail-section h4 { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-detail-item label { font-size: 11px; color: var(--text-muted); font-weight: 600; display: block; }
.order-detail-item span { font-size: 14px; font-weight: 600; }

/* === TIMELINE (in modal) === */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: flex; gap: 12px; align-items: flex-start; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.timeline-content .tl-action { font-size: 13px; font-weight: 600; }
.timeline-content .tl-meta { font-size: 11px; color: var(--text-muted); }

/* === REJECT MODAL === */
.reject-reason-input { width: 100%; padding: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; resize: vertical; min-height: 80px; }

/* === TOAST NOTIFICATIONS === */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px; padding: 14px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px; font-size: 14px;
  animation: slideInRight 0.3s ease; font-weight: 500; color: white;
}
.toast-success { background: var(--secondary); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--accent); }
.toast-info { background: var(--info); }
.toast i { font-size: 18px; flex-shrink: 0; }
.toast-close { margin-left: auto; cursor: pointer; opacity: 0.8; background: none; border: none; color: white; font-size: 16px; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.hiding { animation: slideOutRight 0.3s ease forwards; }
@keyframes slideOutRight { to { transform: translateX(100%); opacity: 0; } }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; display: block; }
.empty-state p { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state small { font-size: 13px; }

/* === ACTION BUTTONS IN TABLE === */
.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center;
  justify-content: center; font-size: 13px; transition: var(--transition); border: 1px solid var(--border);
  background: white; color: var(--text-muted);
}
.action-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.action-btn.danger:hover { background: var(--danger); border-color: var(--danger); }
.action-btn.success:hover { background: var(--secondary); border-color: var(--secondary); }

/* === DASHBOARD DATE DISPLAY === */
#dashboard-date { font-size: 14px; color: var(--text-muted); }

/* === OBRA CONFIG ACTIVE INDICATOR === */
.obra-active-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); display: inline-block; margin-right: 6px; }

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; }
  .sidebar-overlay.visible { display: block; }
  .sidebar-close { display: block; }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: block; }
  .order-form-layout { grid-template-columns: 1fr; }
  .order-info-panel { flex-direction: row; }
  .profile-details { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }
  .content-area { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid-3 { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .validation-info-grid { grid-template-columns: 1fr 1fr; }
  .order-info-panel { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .header-actions { flex-wrap: wrap; }
  .header-obra-wrap { display: none; }
  .header-user-name { display: none; }
  .report-filters { grid-template-columns: 1fr 1fr; }
  .modal-overlay { padding: 12px; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .notif-panel { width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-grid-3 { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .filters-bar { flex-direction: column; }
  .filter-group { min-width: unset; }
  .form-actions { justify-content: stretch; flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .demo-grid { grid-template-columns: 1fr 1fr; }
  .obras-grid { grid-template-columns: 1fr; }
  .config-grid { grid-template-columns: 1fr; }
  .profile-avatar-area { flex-direction: column; text-align: center; }
  .obra-card-footer { flex-direction: column; }
  .toast { min-width: unset; max-width: calc(100vw - 48px); }
  .toast-container { left: 24px; right: 24px; bottom: 16px; }
}

/* === PRINT STYLES === */
@media print {
  .sidebar, .top-header, .filters-bar, .btn, .pagination, .quick-actions-grid { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .content-area { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* === DARK MODE TOGGLE ANIMATION === */
.dark-mode-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg);
  color: var(--text-muted); font-size: 16px; display: flex; align-items: center;
  justify-content: center; transition: var(--transition); border: 1px solid var(--border);
}
.dark-mode-btn:hover { background: var(--primary); color: white; }

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg-dark) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === STATUS FLOW INDICATOR === */
.status-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-flow-item { display: flex; align-items: center; gap: 4px; }
.status-flow-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-flow-arrow { color: var(--border-dark); font-size: 12px; }

/* === FLOATING ACTION BUTTON (mobile) === */
.fab {
  position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--primary); color: white; font-size: 22px;
  box-shadow: var(--shadow-lg); display: none; align-items: center; justify-content: center;
  z-index: 250; transition: var(--transition);
}
.fab:hover { background: var(--primary-dark); transform: scale(1.1); }
@media (max-width: 768px) { .fab { display: flex; } }

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === LOADING SPINNER === */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; }

/* === STAT PROGRESS BAR === */
.progress-bar-wrap { margin-top: 8px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.progress-blue { background: var(--primary); }
.progress-green { background: var(--secondary); }
.progress-red { background: var(--danger); }
.progress-orange { background: var(--accent); }
