
/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
  background: #F5F5F5;
  color: #212121;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }

/* ===== VARIABLES ===== */
:root {
  --cyan-400:      #26C6DA;
  --cyan-700:      #0097A7;
  --cyan-800:      #00838F;
  --teal:          #00897B;
  --bg-page:       #F5F5F5;
  --bg-white:      #FFFFFF;
  --text-dark:     #212121;
  --text-muted:    #757575;
  --border:        #E0E0E0;
  --danger:        #e53935;
  --success:       #2e7d32;
  --sidebar-width: 220px;
  --topbar-height: 60px;
  --radius:        10px;
  --shadow:        0 2px 8px rgba(0,0,0,0.10);
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, var(--cyan-400), var(--cyan-800));
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.login-logo-wrap {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  margin-bottom: 8px;
}
.login-logo-wrap img { width: 60px; height: 60px; object-fit: contain; }
.login-title   { font-size: 22px; font-weight: 700; color: var(--cyan-800); margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 10px; text-align: center; }
.login-form    { width: 100%; display: flex; flex-direction: column; gap: 0; }

/* ===== LAYOUT: SIDEBAR + TOPBAR + CONTENT ===== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
}
.sidebar-logo img { width: 45px; height: 45px; object-fit: contain; }
.sidebar-logo span { font-weight: 700; font-size: 15px; color: var(--cyan-800); line-height: 1.2; }

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-right: 3px solid transparent;
}
.sidebar-link:hover { background: #f0f9fa; color: var(--cyan-700); }
.sidebar-link.active {
  background: #e0f7fa;
  color: var(--cyan-800);
  font-weight: 600;
  border-right-color: var(--cyan-700);
}
.sidebar-icon { font-size: 17px; width: 22px; text-align: center; }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); }

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 99;
}
.topbar-title { font-size: 19px; font-weight: 600; color: var(--cyan-800); }
.topbar-user  { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-muted); }

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topbar-height));
  background: var(--bg-page);
  width: 100%;
}

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 700; color: var(--cyan-800); }
.page-header p  { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

/* ===== CARD ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 560px;
  margin: 0 auto;
  border: none;
}
.card-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--cyan-800);
  margin-bottom: 20px;
  padding-bottom: 12px;
}

/* ===== DASHBOARD ACTION GRID ===== */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}
.action-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 16px;
  text-align: center;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
}
.action-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.14); transform: translateY(-2px); color: var(--cyan-800); }
.action-icon  { font-size: 30px; color: var(--cyan-700); }
.action-label { font-size: 14px; font-weight: 600; }

/* ===== FORMS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dark);
  background: white;
  outline: none;
  transition: border-color 0.15s;
}
.form-control:focus { border-color: var(--cyan-700); box-shadow: 0 0 0 3px rgba(0,151,167,0.12); }
select.form-control { cursor: pointer; }
select[multiple].form-control { height: 110px; padding: 6px; }

.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 44px; }
.toggle-pw {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  display: inline-block;
  text-align: center;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--cyan-700); color: white; }
.btn-primary:hover { background: var(--cyan-800); color: white; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.85; }
.btn-full    { width: 100%; margin-top: 4px; }
.btn-sm      { padding: 6px 14px; font-size: 13px; }

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  width: 100%;
}
.alert-error   { background: #ffebee; color: var(--danger); border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: var(--success); border: 1px solid #c8e6c9; }

/* ===== FORM VALIDATION ===== */
.error-border { border-color: var(--danger) !important; }
.error { font-size: 12px; color: var(--danger); margin-top: 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .topbar  { left: 0; }
  .main-content { margin-left: 0; }
}

/* Fullscreen overlay */
.section-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Wrapper that covers only the commande content area */
#commande-content-wrapper {
    position: relative;
}

/* Local overlay */
.form-loading-overlay {
    position: absolute;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* Hide helper (Bootstrap-like) */
.d-none {
    display: none !important;
}

/* Spinner card */
.form-spinner-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Dots spinner */
.dot-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dot-spinner span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #0d6efd; /* Bootstrap primary */
    opacity: 0.4;
    animation: dot-bounce 0.8s infinite ease-in-out;
}

.dot-spinner span:nth-child(2) {
    animation-delay: 0.15s;
}

.dot-spinner span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Optional: loading text */
/* .loading-text {
    font-size: 0.9rem;
    color: #334155;
} */

