/* ===============================
   Global Reset & Variables
================================= */
:root {
  --brand: #3b82f6;
  --brand-dark: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #f9fafb;
  --white: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Links */
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  color: var(--brand-dark);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* ===============================
   Layout
================================= */
.app-container {
  display: flex;
}

.main-content {
  flex-grow: 1;
  margin-left: 240px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main-content {
  margin-left: 70px;
}

.content-area {
  padding: 1.5rem;
  flex-grow: 1;
}

/* ===============================
   Sidebar
================================= */
.sidebar {
  width: 240px;
  background: #1e1e2d;
  color: var(--white);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  transition: width 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
  padding: 1rem;
}

.sidebar .logo {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-grow: 1;
}

.sidebar-nav li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  text-decoration: none;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-nav a span {
  display: none;
}
.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
}

/* ===============================
   Header / Topbar
================================= */
.header {
    background: #1e1e2d;  /* same as sidebar */
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    height: 100px;
    justify-content: space-between;
    z-index: 1000;
}

.header a,
.header span {
    color: #fff;
}

.header .dropdown-menu {
    background: #2a2a3d;
    border: 1px solid rgba(255,255,255,0.1);
}

.header .dropdown-menu a {
    color: #fff;
}

.header .dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
}


/* ===============================
   Page Header
================================= */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}
.page-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ===============================
   Cards / Stats
================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--white);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
  font-size: 1.8rem;
  color: var(--brand);
}

.stat-content h3 {
  margin: 0;
  font-size: 1.4rem;
}
.stat-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ===============================
   Tables
================================= */
.table-container {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: #f3f4f6;
  font-weight: 600;
  color: var(--muted);
}

.data-table tr:hover td {
  background: #f9fafb;
}

/* ===============================
   Forms
================================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  display: block;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

/* ===============================
   Buttons
================================= */
.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  background: var(--brand);
  color: var(--white);
}

.btn:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: #9ca3af;
}
.btn-secondary:hover {
  background: #6b7280;
}

.btn-success {
  background: var(--success);
}
.btn-danger {
  background: var(--danger);
}
.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* ===============================
   Alerts
================================= */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  position: relative;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #e0f2fe; color: #075985; }

.alert .alert-close {
  position: absolute;
  top: 8px;
  right: 10px;
  cursor: pointer;
}

/* ===============================
   Status Labels
================================= */
.status {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e3a8a; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* ===============================
   Responsive
================================= */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1100;
    transform: translateX(-100%);
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}
/* Header adjustments */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* User dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 180px;
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: none;
  flex-direction: column;
  z-index: 999;
}

.dropdown-menu a {
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dropdown-menu a:hover {
  background: #f3f4f6;
}

.dropdown-menu.show {
  display: flex;
}
/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
}
/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 15% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
}

.modal-header .close:hover {
    color: var(--text);
}

.modal form {
    padding: 1.5rem;
}

/* Toast notifications */
.alert {
    transition: opacity 0.5s ease;
}