/* style.css - Premium SaaS Design System */

:root {
  --primary: #0A7CFF;
  --primary-hover: #0066cc;
  --secondary: #10A37F;
  --bg-color: #f4f7fa;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --purple: #8b5cf6;
  
  --shadow-sm: 0 1px 2px 0 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);
  
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); line-height: 1.5; -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4 { font-weight: 700; color: var(--text-main); }
p { color: var(--text-muted); }

/* Layouts */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 260px; background: var(--card-bg); border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column; padding: 24px 0; z-index: 10;
}
.brand { padding: 0 24px 24px 24px; font-size: 22px; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 10px; }
.nav-links { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.nav-item {
  padding: 12px 16px; border-radius: var(--radius-md); color: var(--text-muted);
  text-decoration: none; font-weight: 600; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.2s ease;
}
.nav-item:hover, .nav-item.active { background: rgba(10, 124, 255, 0.08); color: var(--primary); }

/* Collapsible sub-menus in sidebar */
.nav-parent { position: relative; display: block; }
.nav-parent .nav-arrow {
  margin-left: auto; font-size: 11px; transition: transform 0.25s ease;
}
.nav-parent.open .nav-arrow { transform: rotate(90deg); }
.nav-submenu {
  display: none; flex-direction: column; gap: 2px;
  padding-left: 16px; margin-top: 2px;
}
.nav-parent.open .nav-submenu { display: flex; }
.nav-sub-item {
  padding: 9px 16px; border-radius: var(--radius-md); color: var(--text-muted);
  text-decoration: none; font-weight: 500; font-size: 13px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all 0.2s ease;
  border-left: 2px solid transparent;
}
.nav-sub-item:hover { background: rgba(10, 124, 255, 0.06); color: var(--primary); border-left-color: rgba(10,124,255,0.3); }
.nav-sub-item.active { background: rgba(10, 124, 255, 0.08); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.user-profile { margin-top: auto; padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* Main Content */
.main-content { flex: 1; overflow-y: auto; padding: 32px 48px; background: var(--bg-color); }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.header-title h1 { font-size: 28px; }
.header-title p { font-size: 14px; margin-top: 4px; }

/* Buttons */
.btn {
  padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px;
  cursor: pointer; border: none; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(10, 124, 255, 0.2); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: #f8fafc; }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }

/* Cards & Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 32px; }
.stat-card {
  background: var(--card-bg); padding: 24px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; align-items: center; gap: 16px;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(10, 124, 255, 0.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-info h3 { font-size: 24px; margin-bottom: 4px; }
.stat-info p { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted);}

/* Tables */
.table-container { background: var(--card-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); overflow: hidden; margin-bottom: 32px;}
.table-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: #f8fafc; font-weight: 600; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
td { font-size: 14px; font-weight: 500; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
.form-control {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-md); border: 1px solid var(--border-color);
  font-size: 14px; transition: all 0.2s; background: #f8fafc; outline:none;
}
.form-control:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.1); }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 1000; opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal {
  background: var(--card-bg); width: 100%; max-width: 550px; max-height: 90vh; overflow-y: auto;
  border-radius: var(--radius-xl); padding: 32px; box-shadow: var(--shadow-lg);
  transform: translateY(20px); transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; margin-top: 32px; justify-content: flex-end; }

/* Config sections for Photographers */
.config-section { background: #f8fafc; padding: 20px; border-radius: var(--radius-md); margin-bottom: 20px; border: 1px solid var(--border-color); }
.category-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }

/* Login Screen specific */
.auth-wrapper { display: flex; height: 100vh; align-items: center; justify-content: center; background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%); }
.auth-card {
  background: white; padding: 48px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; text-align: center; border: 1px solid rgba(10, 124, 255, 0.1);
}
.auth-brand { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 8px;}
.auth-subtitle { color: var(--text-muted); margin-bottom: 32px;}

.role-tabs { display: flex; margin-bottom: 24px; background: #f1f5f9; border-radius: var(--radius-md); padding: 4px; }
.role-tab { flex: 1; padding: 10px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-md); transition: .2s; }
.role-tab.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* Invoices UI */
.invoice-preview { background: #fff; padding: 40px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); font-family: 'Courier New', Courier, monospace; }
.invoice-header { display: flex; justify-content: space-between; border-bottom: 2px solid #eee; padding-bottom: 20px; margin-bottom: 20px;}
.invoice-totals { text-align: right; margin-top: 20px; border-top: 2px solid #eee; padding-top: 20px;}

.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
