:root {
  --green: #58bc2e;
  --green-2: #398235;
  --green-soft: #8ab66b;
  --lime: #a3d213;
  --cyan: #01b4ee;
  --cyan-2: #00a0d2;
  --blue: #337ab7;
  --red: #e01239;
  --ink: #565656;
  --line: #aaa;
}

* { box-sizing: border-box; outline: none; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font: 14px/1.45 Lato, "Open Sans", sans-serif;
  background: #eeeeee;
  background: linear-gradient(to bottom, #eeeeee 0%, #cccccc 100%);
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--green-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

h1, h2, h3, h4, .toptitle, .red {
  font-family: Oswald, sans-serif;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 500;
  letter-spacing: 0.02em;
}
h3.red, h4.red { margin: 10px 0 6px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: 20px 24px 40px; max-width: 1200px; width: 100%; margin: 0 auto; }
.auth-main { display: flex; justify-content: center; padding-top: 36px; }

/* —— Barre noire 68px —— */
.page-header {
  background: #000;
  height: 68px;
  border-bottom: 1px solid #555;
  box-shadow: 0 1px 5px rgba(129, 138, 143, 0.15);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}
.page-header .logo {
  height: 45px;
  width: 45px;
  margin: 0 12px 0 0;
  display: block;
}
.page-header .logo img {
  height: 45px;
  width: 45px;
  object-fit: contain;
  display: block;
}
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  height: 68px;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}
.header-nav > .dropdown { position: relative; display: flex; }
.header-nav > .dropdown > a,
.header-nav > .dropdown > button.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  color: var(--lime);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  height: 68px;
}
.header-nav > .dropdown.selected > a,
.header-nav > .dropdown.open > a,
.header-nav > .dropdown:hover > a,
.header-nav > .dropdown.open > button,
.header-nav > .dropdown:hover > button {
  color: #fff;
  background: linear-gradient(to bottom, #131313 0%, #595959 100%);
  border-bottom: 2px solid var(--lime);
}
.menu-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--lime);
  font-size: 22px;
  cursor: pointer;
  padding: 0 10px;
}

/* —— Navbar grise dropdowns —— */
.navbar {
  background: #fff;
  background: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%);
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  border-bottom: solid 1px #aaa;
}
.navbar-inner { display: flex; align-items: stretch; max-width: 1200px; margin: 0 auto; }
.nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav > .dropdown { position: relative; }
.nav > .dropdown > a {
  display: block;
  font-size: 15px;
  color: var(--blue);
  padding: 15px 15px;
  border-right: solid 1px #aaa;
  white-space: nowrap;
}
.nav > .dropdown:hover > a,
.nav > .dropdown.open > a,
.nav > .dropdown > a.active {
  text-decoration: none;
  color: #fff;
  background: #8ab66b;
  background: linear-gradient(to bottom, #8ab66b 0%, #398235 100%);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 240px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.18);
}
.dropdown-menu.wide { min-width: 350px; }
.dropdown.open > .dropdown-menu,
.dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu > li > a,
.dropdown-menu > li > button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 16px;
  color: #333;
  cursor: pointer;
  font-size: 14px;
  white-space: normal;
}
.dropdown-menu > li > a i,
.dropdown-menu > li > button i,
.nav > .dropdown > a i { margin-right: 6px; }
.dropdown-menu > li > a:hover,
.dropdown-menu > li > button:hover,
.dropdown-menu > li > a.active {
  color: #fff;
  background: #8ab66b;
  background: linear-gradient(to bottom, #8ab66b 0%, #398235 100%);
}
.nav-header {
  color: #999;
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  padding: 8px 16px 4px;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.divider {
  height: 1px;
  margin: 8px 0;
  overflow: hidden;
  background: #e5e5e5;
  border-bottom: 1px solid #fff;
}
.caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-top: 4px solid;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

/* —— Cartes (content-border) —— */
.card, .panel, .content-card, .modal {
  background: #fff;
  background: linear-gradient(to bottom, #ffffff 0%, #eeeeee 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 15px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
.content-card { width: min(640px, 100%); overflow: hidden; }
.content-card-head { padding: 16px 24px 8px; border-bottom: 1px solid #aaa; text-align: center; }
.content-card-head p { color: #666; margin: 0 0 8px; }
.content-card-body { padding: 24px 40px 28px; }
.content-card-foot {
  padding: 16px 24px 24px;
  border-top: 1px solid #ddd;
  text-align: center;
}
.content-card-foot p { color: #666; }

.input-group { display: flex; margin: 12px 0; }
.input-group + .input-group { margin-top: 16px; }
.input-group .addon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  background: #eee;
  border: 1px solid #bbc2cd;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  color: #777;
}
.input-group input {
  border-radius: 0 4px 4px 0;
}
.forgot { text-align: right; margin: 6px 0 0; }

label { display: block; font-size: 13px; color: #777; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  height: 45px;
  background: #fff;
  border: 1px solid #bbc2cd;
  border-radius: 4px;
  padding: 10px 12px;
}
textarea { height: auto; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan-2); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 11px 18px;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(to bottom, #01b4ee 0%, #00a0d2 100%);
}
.btn-primary:hover { background: linear-gradient(to bottom, #01b4f8 0%, #00a0dc 100%); color: #fff; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-ghost, .btn-nice { background: #eee; border-color: #ccc; color: #333; }
.btn-ghost:hover, .btn-nice:hover, .btn-gold:hover, .btn-navy:hover, .quick a:hover, .quick button:hover {
  color: #fff;
  background: linear-gradient(to bottom, #8ab66b 0%, #398235 100%);
  border-color: #398235;
}
.btn-gold, .btn-navy { background: #eee; border-color: #ccc; color: #333; }
.btn-ok, .btn-success {
  color: #fff;
  background: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
  border-color: #398439;
}
.btn-ok:hover, .btn-success:hover { color: #fff; filter: brightness(1.05); }
.btn-sm { padding: 7px 10px; font-size: 13px; width: auto; margin: 0; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.alert { padding: 10px 12px; border-radius: 4px; margin-bottom: 14px; font-size: 14px; }
.alert-danger { background: #fde8eb; color: #8d1020; border: 1px solid #f3c0c7; }
.alert-ok { background: #def0d6; color: #3a7a2a; border: 1px solid #b7d9a8; }
.muted { color: #777; }
.lang { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.lang button { background: none; border: 0; color: #999; cursor: pointer; padding: 0; }
.lang button.active { color: var(--green); font-weight: 700; }

.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 28px; }
.crumb { color: #888; font-size: 12px; margin-bottom: 4px; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.panel { padding: 0; overflow: hidden; }
.panel > h3, .panel > p, .panel > div, .panel > form, .panel > table, .panel > .quick, .panel > .actions, .panel > .person {
  padding-left: 16px;
  padding-right: 16px;
}
.panel > h3 {
  padding-top: 12px;
  margin: 0 0 8px;
  font-size: 18px;
  border-bottom: 1px solid #aaa;
  padding-bottom: 10px;
}
.panel > p, .panel > .quick, .panel > form, .panel > .actions { padding-bottom: 14px; }
.stat { padding: 16px !important; }
.stat .k { color: #777; font-size: 12px; text-transform: uppercase; }
.stat .v { font-family: Oswald, sans-serif; font-size: 32px; color: var(--green); margin-top: 4px; }
.stat.hot .v { color: var(--red); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { flex: 1; min-width: 220px; height: 40px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid #ddd; font-size: 14px; }
th { color: #777; font-weight: 700; font-size: 12px; text-transform: uppercase; }
tr:nth-child(even) { background: #f9f9f9; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 10px; color: #fff; background: #e5163c; }
.badge-ok { background: var(--green); }
.badge-wait { background: #f0ad4e; color: #fff; }
.badge-off { background: #aaa; }
.empty { padding: 28px 12px; text-align: center; color: #777; }
.person { display: flex; gap: 14px; align-items: flex-start; padding: 16px !important; }
.person .big, .avatar {
  border-radius: 50%;
  border: 2px solid var(--green);
  background: #fff;
  color: var(--green-2);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.avatar { width: 32px; height: 32px; font-size: 12px; }
.person .big { width: 84px; height: 84px; font-size: 22px; }
img.big, img.avatar, img.card-photo { object-fit: cover; }
.avatar { flex: 0 0 auto; }
.view-switch { display: flex; gap: 0; }
.view-switch .btn { border-radius: 0; }
.view-switch .btn:first-child { border-radius: 4px 0 0 4px; }
.view-switch .btn:last-child { border-radius: 0 4px 4px 0; }
.view-switch .btn.active {
  color: #fff;
  background: linear-gradient(to bottom, #8ab66b 0%, #398235 100%);
  border-color: #398235;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.profile-card {
  background: #fff;
  box-shadow: 0 2px 2px rgba(0,0,0,.1), 0 6px 10px rgba(0,0,0,.1);
  overflow: hidden;
}
.profile-card-body {
  display: flex;
  gap: 12px;
  min-height: 160px;
  padding: 14px 14px 10px;
}
.profile-card-info { flex: 1; min-width: 0; }
.profile-card-info h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #333;
  text-transform: none;
  font-family: Lato, sans-serif;
  font-weight: 700;
}
.profile-card-info h4 i { color: var(--green); margin-right: 4px; }
.profile-labels { min-height: 22px; margin-bottom: 8px; }
.label {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.label-danger { background: #d9534f; }
.profile-card-photo { flex: 0 0 110px; text-align: center; }
.card-photo, .profile-card-photo .big {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid #e6e9ed;
  padding: 2px;
  background: #fff;
  object-fit: cover;
}
.profile-card-photo .card-photo,
.profile-card-photo .big {
  display: grid;
  place-items: center;
  color: var(--green-2);
  font-weight: 700;
  font-size: 28px;
}
.profile-card-bottom {
  background: #f2f5f7;
  border-top: 1px solid #e6e9ed;
  padding: 9px 12px;
  display: flex;
  gap: 6px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0 16px;
  color: #777;
  font-weight: 700;
}
.pager [disabled] { opacity: .45; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 16px !important; padding-top: 8px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 16px !important; }
.quick a, .quick button {
  display: block; width: 100%; text-align: left;
  background: #eee; border: 1px solid #ccc;
  border-radius: 4px; padding: 10px 12px; cursor: pointer; font-weight: 700; color: #333;
}
.help-box { border: 1px solid #aaa; border-radius: 4px; padding: 14px; margin: 12px 16px 16px; background: #f2f5f7; }
.help-box strong { color: var(--green-2); }
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal-bg[hidden] { display: none !important; }
.modal { width: min(560px, 100%); padding: 8px 0 16px; }
.modal h3 { margin: 0; padding: 10px 16px; border-bottom: 1px solid #aaa; }
.modal form { padding: 8px 16px 16px; }

.site-footer {
  background: #000;
  color: #fff;
  border-top: 1px solid #555;
  padding: 28px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 21px;
  margin-top: auto;
}
.site-footer p { margin: 0; color: #fff; font-family: Lato, sans-serif; }

@media (max-width: 980px) {
  .span-3, .span-4, .span-6, .span-8 { grid-column: span 12; }
  .row, .quick { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
  .menu-toggle { display: block; }
  .header-nav { display: none; }
  .navbar { display: none; }
  .navbar.open { display: block; }
  .navbar-inner, .nav { display: block; }
  .nav > .dropdown > a { border-right: 0; border-bottom: 1px solid #aaa; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; border-radius: 0; display: none; background: #f7f7f7; }
  .dropdown.open > .dropdown-menu { display: block; }
  .dropdown:hover > .dropdown-menu { display: none; }
  .dropdown.open:hover > .dropdown-menu { display: block; }
  .content-card-body { padding: 20px 16px; }
}
@media (max-width: 640px) {
  .photo-grid { grid-template-columns: 1fr; }
}
