/* assets/css/style.css - Modern Design System for Arunn Crackers Billing System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #0ea5e9;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --dark-sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--dark-sidebar);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 100;
}

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

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.sidebar-subtitle {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  padding: 20px 12px;
  list-style: none;
  flex: 1;
}

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

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

.sidebar-link:hover, .sidebar-link.active {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.2), transparent);
  border-left: 4px solid var(--primary-color);
  color: #ffffff;
}

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

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

.top-nav {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: var(--shadow-sm);
}

.page-title-group h1 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

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

/* Cards & Components */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

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

.stat-card {
  background: #ffffff;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.stat-icon.blue { background: #e0f2fe; color: #0284c7; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.purple { background: #e0e7ff; color: #4338ca; }

.stat-info .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.2s;
  background-color: #ffffff;
}

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

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

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

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

.table th {
  background-color: #f1f5f9;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border-color);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

/* Invoice Editor Table */
.invoice-table th, .invoice-table td {
  padding: 8px 10px;
}

.invoice-table input.form-control {
  padding: 6px 10px;
  font-size: 13px;
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

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

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-success {
  background-color: var(--success-color);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
}

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.badge {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-info { background: #e0f2fe; color: #075985; }

/* Alert Messages */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Printable Invoice Styles */
.invoice-print-container {
  background: #fff;
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid #cbd5e1;
  max-width: 900px;
  margin: 0 auto;
}

.invoice-header-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.company-logo-img {
  max-height: 80px;
  max-width: 220px;
  object-fit: contain;
}

.invoice-summary-box {
  margin-left: auto;
  width: 320px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.summary-row.total-row {
  background-color: #f1f5f9;
  font-weight: 700;
  font-size: 15px;
  border-bottom: none;
}

/* Login Page Specific */
.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Print Rules */
@media print {
  body {
    background: #fff;
    color: #000;
  }
  .sidebar, .top-nav, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin: 0;
    padding: 0;
  }
  .content-body {
    padding: 0;
  }
  .invoice-print-container {
    border: none;
    padding: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
  }
}
