/* =========================================================
   Medical UI Theme – Blue / Green
   Font: Cairo
   Responsive + Mobile Friendly
   ========================================================= */

/* ===== Fonts (Cairo local) ===== */
@font-face{
  font-family:"Cairo";
  src:url("/app/assets/fonts/cairo/Cairo-Regular.ttf") format("truetype");
  font-weight:400;
  font-style:normal;
}
@font-face{
  font-family:"Cairo";
  src:url("/app/assets/fonts/cairo/Cairo-SemiBold.ttf") format("truetype");
  font-weight:600;
  font-style:normal;
}
@font-face{
  font-family:"Cairo";
  src:url("/app/assets/fonts/cairo/Cairo-Bold.ttf") format("truetype");
  font-weight:700;
  font-style:normal;
}

/* ===== Root (Medical Colors) ===== */
:root{
  /* Backgrounds */
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface2: #f1f5f9;

  /* Text */
  --text: #1f2937;
  --muted: #6b7280;

  /* Medical Colors */
  --brand: #1e88e5;     /* Medical Blue */
  --brand2: #64b5f6;    /* Light Blue */
  --ok: #2e7d32;        /* Medical Green */
  --danger: #c62828;    /* Medical Red */
  --warning: #f9a825;   /* Warning Yellow */

  /* Borders & Shadows */
  --border: #e5e7eb;
  --shadow: 0 8px 30px rgba(15,23,42,.08);

  --radius: 16px;
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:"Cairo", Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, #eef4f9, var(--bg));
  color: var(--text);
}

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

/* ===== Layout ===== */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 90px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.brand h1{
  margin:0;
  font-size:20px;
  font-weight:700;
}
.brand p{
  margin:2px 0 0;
  font-size:13px;
  color:var(--muted);
}

/* ===== Buttons ===== */
.btn, button{
  appearance:none;
  border:1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:600;
  transition:.15s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:hover, button:hover{
  background:#e8f2fd;
}

.btn.primary{
  border:none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#fff;
}
.btn.primary:hover{
  filter: brightness(0.95);
}

.btn.danger{
  border-color: rgba(198,40,40,.35);
  background: rgba(198,40,40,.08);
  color: var(--danger);
}

/* ===== Cards ===== */
.card{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
  margin-bottom:12px;
}

/* ===== Grid ===== */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:12px;
}

/* ===== Forms ===== */
label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
}

input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  font-family:inherit;
  font-size:15px;
}
textarea{
  min-height:110px;
  resize:vertical;
}

input:focus, textarea:focus, select:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(30,136,229,.15);
}

/* ===== Alerts ===== */
.alert{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#f8fafc;
}
.alert.danger{
  border-color: rgba(198,40,40,.35);
  background: rgba(198,40,40,.08);
  color: var(--danger);
}
.alert.ok{
  border-color: rgba(46,125,50,.35);
  background: rgba(46,125,50,.08);
  color: var(--ok);
}

/* ===== Tables ===== */
.table{
  width:100%;
  border-collapse:collapse;
}
.table th, .table td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  text-align:right;
}
.table th{
  background: var(--surface2);
  font-size:13px;
  color:var(--muted);
}
.table tr:hover td{
  background:#f8fafc;
}

/* ===== Accordion ===== */
.acc{
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  background:var(--surface);
  margin-bottom:12px;
}
.acc summary{
  list-style:none;
  cursor:pointer;
  padding:12px 14px;
  font-weight:700;
  display:flex;
  justify-content:space-between;
}
.acc summary::-webkit-details-marker{ display:none; }
.acc .acc-body{
  padding:12px 14px;
  border-top:1px solid var(--border);
}

/* ===== Pills ===== */
.pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:#e3f2fd;
  color:#1565c0;
  font-size:12px;
  font-weight:600;
}

/* ===== Action Bar (Mobile) ===== */
.actionbar{
  position:fixed;
  left:10px;
  right:10px;
  bottom:10px;
  z-index:50;
  background: rgba(255,255,255,.95);
  border:1px solid var(--border);
  border-radius:18px;
  padding:10px;
  box-shadow: var(--shadow);
}
.actionbar .row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.actionbar .row .btn{
  flex:1 1 160px;
}

/* ===== Helpers ===== */
.small{
  font-size:13px;
  color:var(--muted);
}
hr.sep{
  border:none;
  border-top:1px solid var(--border);
  margin:12px 0;
}

/* ===== Responsive ===== */
@media (max-width:640px){
  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }
  .btn, button{
    width:100%;
  }
  input, textarea{
    font-size:16px; /* يمنع zoom في iOS */
  }
  .table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }
}
