:root{
  --bg:#f3f3f1;
  --card:#fff;
  --ink:#333;
  --muted:#666;
  --line:#e1e1df;
  --accent:#df1b0c;
  --accent-dark:#bd1508;
  --green:#9dbc35;
  --yellow:#ffcc00;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--ink);
}

a{
  color:var(--accent);
  text-decoration:none;
}

.wrap{
  max-width:1600px;
  width:100%;
  margin:0 auto;
  padding:14px;
}

/* Header */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:30px;
  padding:14px 0 18px;
  margin-bottom:20px;
  border-bottom:1px solid #ddd;
}

.brand{
  display:flex;
  align-items:flex-end;
  gap:18px;
  flex-shrink:0;
}

.brand-logo{
  height:50px;
  width:auto;
  display:block;
}

.brand-subtitle{
  color:var(--accent);
  font-size:20px;
  font-weight:800;
  line-height:1.1;
}

.nav{
  display:flex;
  align-items:center;
  gap:32px;
  flex-wrap:wrap;
}

.nav a{
  background:transparent;
  color:#333;
  border-bottom:4px solid transparent;
  padding:12px 2px 8px;
  font-weight:700;
  transition:.2s;
}

.nav a:hover,
.nav a.active{
  color:var(--accent);
  border-bottom-color:var(--accent);
}

.nav a.logout{
  color:#666;
}

/* Layout */
.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:18px;
}

.span4{grid-column:span 4}
.span6{grid-column:span 6}
.span8{grid-column:span 8}
.span12{grid-column:span 12}

.card{
  background:var(--card);
  border:1px solid var(--line);
  padding:24px;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.big{
  font-size:34px;
  font-weight:800;
  color:var(--accent);
}

.muted{
  color:var(--muted);
}

.msg{
  padding:14px 16px;
  background:#fff3cf;
  border-left:6px solid var(--yellow);
  margin-bottom:16px;
}

.err{
  background:#ffe5e0;
  border-color:var(--accent);
}

.ok{
  background:#eef7d4;
  border-color:var(--green);
}

/* Buttons / forms */
.btn{
  border:0;
  padding:12px 18px;
  background:#eee;
  color:var(--ink);
  font-weight:700;
  cursor:pointer;
  display:inline-block;
}

.btn.primary{
  background:var(--accent);
  color:#fff;
}

.btn.primary:hover{
  background:var(--accent-dark);
}

.btn.danger{
  background:var(--accent);
  color:#fff;
}

input,select,textarea{
  width:100%;
  padding:12px;
  border:1px solid #d6d6d6;
  background:#f7f7f7;
  font:inherit;
  border-radius:0;
}

input:focus,
textarea:focus,
select:focus{
  outline:2px solid var(--green);
  background:#fff;
}

textarea{
  min-height:90px;
}

.formgrid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}

.full{
  grid-column:1/-1;
}

.date-filter{
  display:flex;
  gap:8px;
  align-items:end;
  margin-bottom:16px;
}

.date-filter label{
  font-weight:700;
}

.date-filter input{
  width:180px;
}

/* Tables */
table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
}

td{
  padding:6px 8px;
  line-height:1.1;
}

th{
  padding:8px;
}
/* Dashboard */
.dashboard-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}

/* Orders */
.desktop-orders{
  display:block;
  overflow-x:auto;
}

.mobile-orders{
  display:none;
}

.desktop-orders table{
  min-width:1000px;
  table-layout:fixed;
}

.desktop-orders th,
.desktop-orders td{
  padding:8px 7px;
  font-size:14px;
  line-height:1.15;
}

.desktop-orders th:nth-child(1),
.desktop-orders td:nth-child(1){width:45px}

.desktop-orders th:nth-child(2),
.desktop-orders td:nth-child(2){width:110px}

.desktop-orders th:nth-child(3),
.desktop-orders td:nth-child(3){width:160px}

.desktop-orders th:nth-child(4),
.desktop-orders td:nth-child(4){width:230px}

.desktop-orders th:nth-child(5),
.desktop-orders td:nth-child(5){width:110px}

.desktop-orders th:nth-child(6),
.desktop-orders td:nth-child(6){width:80px}

.desktop-orders th:nth-child(7),
.desktop-orders td:nth-child(7){width:120px}

.desktop-orders th:nth-child(8),
.desktop-orders td:nth-child(8){width:120px}

.desktop-orders th:nth-child(9),
.desktop-orders td:nth-child(9){width:180px}

.attention-form{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
}

.attention-form input{
  width:130px;
  min-width:130px;
  padding:8px;
}

.attention-form button{
  width:95px;
  min-width:95px;
  padding:8px 10px;
  white-space:nowrap;
  font-size:13px;
}

/* Mobile order cards */
.order-card{
  background:#fff;
  border:1px solid var(--line);
  border-left:6px solid var(--accent);
  padding:14px;
  margin-bottom:10px;
}

.order-summary{
  display:grid;
  grid-template-columns:minmax(0,1fr) 110px 24px;
  gap:10px;
  align-items:center;
  cursor:pointer;
  font-weight:700;
  list-style:none;
}

.order-summary::-webkit-details-marker{
  display:none;
}

.order-summary::after{
  content:"›";
  font-size:24px;
  color:var(--accent);
  text-align:right;
}

details[open] .order-summary::after{
  content:"⌄";
}

.order-summary > span:first-child{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.order-summary > span:nth-child(2){
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.order-card-line,
.order-card-meta,
.order-card-status{
  margin-top:10px;
}

.order-card-meta{
  color:var(--muted);
  border-top:1px solid var(--line);
  padding-top:8px;
}

.mobile-attention-form{
  display:grid;
  gap:8px;
  margin-top:10px;
}

/* Order detail products */
.order-detail-row td{
  background:#fafafa;
  padding:0 12px 14px;
}

.order-products{
  margin-top:8px;
}

.order-products summary{
  cursor:pointer;
  color:var(--accent);
  font-weight:700;
  padding:8px 0;
}

.order-products-table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  font-size:14px;
}

.order-products-table th{
  background:#eee;
  color:#333;
  padding:8px;
}

.order-products-table td{
  padding:8px;
  border-bottom:1px solid var(--line);
}

.order-products-table td:nth-child(4),
.order-products-table td:nth-child(5){
  text-align:right;
  white-space:nowrap;
}

.order-addition td{
  color:var(--muted);
  background:#f7f7f7;
}

/* Attentielijst */
.attention-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.attention-item{
  background:#fff;
  border:1px solid var(--line);
}

.attention-summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px;
  cursor:pointer;
  list-style:none;
}

.attention-summary::-webkit-details-marker{
  display:none;
}

.attention-main{
  flex:1;
}

.attention-name{
  font-size:18px;
  font-weight:700;
  margin-bottom:6px;
}

.attention-phone{
  color:var(--accent);
  margin-bottom:6px;
}

.attention-address{
  color:var(--muted);
  line-height:1.35;
}

.attention-address span{
  display:block;
}

.attention-arrow{
  font-size:28px;
  color:var(--accent);
  margin-left:20px;
  transition:.2s;
}

.attention-item[open] .attention-arrow{
  transform:rotate(90deg);
}

.attention-body{
  border-top:1px solid var(--line);
  background:#fafafa;
  padding:20px;
}

.attention-detail-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px;
}

.attention-detail-grid .full{
  grid-column:1/-1;
}

.attention-actions{
  display:flex;
  gap:10px;
  margin-top:20px;
}

.attention-actions form{
  margin:0;
}

.attention-actions .btn{
  min-width:120px;
}

/* Login */
.login-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:calc(100vh - 140px);
}

.login-card{
  width:100%;
  max-width:520px;
  border-top:8px solid var(--accent);
}

/* Tablet */
@media(max-width:1400px){
  .top{
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
  }

  .nav{
    width:100%;
    justify-content:flex-start;
  }

  .span4,.span6,.span8{
    grid-column:span 12;
  }
}

/* Mobile */
@media(max-width:900px){
  .wrap{
    padding:10px;
  }

  .top{
    padding:6px 0 10px;
    margin-bottom:10px;
    display:block;
  }

  .brand{
    display:flex;
    align-items:flex-end;
    gap:10px;
    margin-bottom:8px;
  }

  .brand-logo{
    height:30px;
    margin:0;
  }

  .brand-subtitle{
    font-size:14px;
    line-height:1.05;
  }

  .nav{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:0;
    width:100%;
    background:#fff;
    border:1px solid var(--line);
  }

  .nav a{
    background:#fff;
    color:#333;
    border:0;
    border-right:1px solid var(--line);
    border-bottom:3px solid transparent;
    padding:8px 4px;
    font-size:11px;
    text-align:center;
  }

  .nav a:last-child{
    border-right:0;
  }

  .nav a:hover,
  .nav a.active{
    color:var(--accent);
    background:#fff;
    border-bottom-color:var(--accent);
  }

  .nav .logout-text{
    display:none;
  }

  .nav .logout-icon{
    font-size:16px;
  }

  .grid{
    gap:10px;
  }

  .card{
    padding:14px;
  }

  .card h2{
    margin-top:0;
    font-size:24px;
  }

  .big{
    font-size:28px;
    line-height:1;
  }

  .dashboard-stats{
    grid-template-columns:repeat(3,1fr);
    gap:8px;
  }

  .dashboard-stats .card{
    padding:10px;
    text-align:center;
    min-height:auto;
  }

  .dashboard-stats h3{
    font-size:12px;
    margin:0 0 4px;
    color:var(--muted);
  }

  .desktop-orders{
    display:none;
  }

  .mobile-orders{
    display:block;
  }

  input,select,textarea{
    font-size:16px;
  }

  .formgrid{
    grid-template-columns:1fr;
  }

  .date-filter{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .date-filter label{
    grid-column:1/-1;
  }

  .date-filter input,
  .date-filter button,
  .date-filter .btn{
    width:100%;
  }

  .order-products-table{
    font-size:12px;
  }

  .order-products-table th,
  .order-products-table td{
    padding:6px;
  }

  .attention-summary{
    padding:14px;
  }

  .attention-name{
    font-size:17px;
  }

  .attention-phone,
  .attention-address{
    font-size:14px;
  }

  .attention-detail-grid{
    grid-template-columns:1fr;
  }

  .attention-actions{
    flex-direction:column;
  }

  .attention-actions .btn{
    width:100%;
  }
}