/* 
  Salary Manager - Modern Design System 
  Font: Inter (Google Fonts)
*/

:root {
  /* Color Palette */
  --bg-body: #f8fafc;
  /* Very light slate */
  --bg-surface: #ffffff;
  /* White */
  --bg-sidebar: #1e293b;
  /* Dark Slate */

  --primary: #3b82f6;
  /* Soft Blue */
  --primary-hover: #2563eb;
  --secondary: #64748b;
  /* Slate Grey */
  --secondary-hover: #475569;

  --success: #10b981;
  /* Emerald */
  --danger: #ef4444;
  /* Red */
  --warning: #f59e0b;
  /* Amber */

  --text-main: #334155;
  /* Slate 700 */
  --text-heading: #0f172a;
  /* Slate 900 */
  --text-light: #94a3b8;
  /* Slate 400 */
  --text-white: #f8fafc;

  --border: #e2e8f0;
  /* Slate 200 */

  /* Shadows */
  --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);

  /* Spacing & Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Layout */
.container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.main {
  padding: 30px;
  overflow-y: auto;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  padding: 25px 0;
  display: flex;
  flex-direction: column;
}

.sidebar h2 {
  padding: 0 25px 25px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 12px 25px;
  color: #cbd5e1;
  /* Slate 300 */
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

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

.sidebar a.active {
  background-color: rgba(59, 130, 246, 0.1);
  /* Primary with opacity */
  color: var(--primary);
  /* Highlight text with primary color */
  border-left-color: var(--primary);
}

.sidebar i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-section-title {
  padding: 25px 25px 10px;
  color: #64748b;
  /* Slate 500 */
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.025em;
}

/* Cards */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.card h3 {
  color: var(--text-light);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 10px;
}

.card .value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
}

/* Stats Grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.4);
}

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

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

.quick-btn {
  background-color: var(--bg-surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

th,
td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: #f8fafc;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

tr:hover td {
  background-color: #f8fafc;
}

.actions a {
  margin-right: 12px;
  color: var(--text-light);
  transition: color 0.2s;
}

.actions a:hover {
  color: var(--primary);
}

.actions a.delete:hover {
  color: var(--danger);
}

/* Forms */
.form-card {
  background: var(--bg-surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 600px;
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-heading);
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-heading);
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Utilities */
.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    /* Override display: none from previous media query if it existed, though we removed it */
  }

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

  .main {
    padding: 20px;
  }

  .menu-toggle {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-heading);
    margin-right: 15px;
  }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

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