/* 
 * Rotex Stock & Operator Consumption Management System
 * Global CSS Design System & Premium UI Theme
 */

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

:root {
  /* Premium Business Palette */
  --primary: #4f46e5;       /* Indigo 600 */
  --primary-hover: #4338ca; /* Indigo 700 */
  --secondary: #7c3aed;     /* Violet 600 */
  --dark: #0f172a;          /* Slate 900 */
  --dark-light: #1e293b;    /* Slate 800 */
  --light: #f8fafc;         /* Slate 50 */
  --text-main: #334155;     /* Slate 700 */
  --text-muted: #64748b;    /* Slate 500 */
  --border: #e2e8f0;        /* Slate 200 */
  --border-focus: #a5b4fc;  /* Indigo 300 */
  
  /* Status Colors */
  --success: #10b981;       /* Emerald 500 */
  --success-bg: #ecfdf5;
  --warning: #f59e0b;       /* Amber 500 */
  --warning-bg: #fffbeb;
  --danger: #ef4444;        /* Red 500 */
  --danger-bg: #fef2f2;
  --info: #0ea5e9;          /* Sky 500 */
  --info-bg: #f0f9ff;
  
  /* Font Stacks */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevations & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
}

/* Global Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: #f1f5f9;
  line-height: 1.5;
  min-height: 100vh;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--dark);
  font-weight: 700;
}

/* --- AUTHENTICATION FLOW LAYOUTS --- */
.auth-page {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e1b4b 100%);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  color: white;
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 14px;
  font-weight: 800;
  font-size: 24px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.auth-title {
  color: white;
  font-size: 28px;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: #94a3b8;
  font-size: 14px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-page .form-label {
  color: #cbd5e1;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: white;
  color: var(--dark);
  transition: all 0.2s ease;
}

.auth-page .form-control {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-page .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
  background-color: rgba(15, 23, 42, 0.8);
}

/* Form Select wrapper override styling */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

.auth-page select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23cbd5e1'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.btn-block {
  width: 100%;
}

/* Flash Messages / Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 110, 0.2);
}

.auth-meta-links {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #94a3b8;
}

.auth-meta-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-meta-links a:hover {
  color: white;
  text-decoration: underline;
}

/* --- DASHBOARD SHELL LAYOUT --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Left Sidebar Navigation */
.app-sidebar {
  width: 280px;
  background-color: var(--dark);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  border-radius: 10px;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.sidebar-menu {
  padding: 24px 16px;
  flex-grow: 1;
  list-style-type: none;
  margin-left: 0;
}

.sidebar-item {
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* Main Dashboard Workspace */
.app-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header Top-bar */
.app-header {
  height: 70px;
  background-color: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 20px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fy-badge {
  background-color: var(--info-bg);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--info);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

select.fy-select {
  background-color: var(--info-bg);
  border: 1px solid rgba(14, 165, 233, 0.2);
  color: var(--info);
  padding: 6px 32px 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230ea5e9'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
  cursor: pointer;
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

select.fy-select:focus, select.fy-select:hover {
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--border);
  padding-left: 20px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background-color: #e2e8f0;
  color: var(--dark-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-logout {
  padding: 8px 14px;
  font-size: 13px;
  background-color: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background-color: var(--danger);
  color: white;
}

/* Page Workspace Wrapper */
.app-body {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Dashboard Cards KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  background-color: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-info h4 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.kpi-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--dark);
  font-family: var(--font-display);
  line-height: 1;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--light);
  color: var(--primary);
}

.kpi-icon svg {
  width: 24px;
  height: 24px;
}

/* Panels */
.panel {
  background-color: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.panel-header {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

/* Password Eye-Toggle styling */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 48px;
}

.password-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: #cbd5e1;
}

.auth-page .password-toggle-btn:hover {
  color: white;
}

/* Modern CRUD Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 15px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background-color: var(--light);
  color: var(--dark-light);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.data-table tr:hover {
  background-color: #f8fafc;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Modal Dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: white;
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Badges & Icons */
.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }
.badge-warning { background-color: var(--warning-bg); color: var(--warning); }
.badge-info { background-color: var(--info-bg); color: var(--info); }

/* Form layout utility rows */
.form-row {
  display: flex;
  gap: 20px;
}

.form-row .form-group {
  flex: 1;
}

.btn-secondary {
  background-color: white;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--light);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 6px;
  border-radius: 6px;
  background-color: var(--light);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: #cbd5e1;
  color: var(--dark);
}

.btn-icon.edit-btn:hover {
  color: var(--primary);
  border-color: #a5b4fc;
}

.btn-icon.delete-btn:hover {
  color: var(--danger);
  border-color: #fca5a5;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Search & Pagination Additions */
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
}

.search-input {
  padding: 8px 16px 8px 36px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  width: 220px;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 52%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 13.5px;
  color: var(--text-muted);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-link:hover {
  background-color: var(--light);
  border-color: var(--text-muted);
  color: var(--dark);
}

.pagination-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.pagination-link.disabled {
  opacity: 0.5;
  pointer-events: none;
  background-color: #f1f5f9;
  color: #94a3b8;
}


