/* ============================================
   RXLY — AZM Pharma Design System
   Inspired by azmpharma.com + DrAnsay UX
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600&family=Lora:wght@400;500;600&display=swap');

:root {
  /* Colors — AZM Pharma palette */
  --blue-dark:   #0A1628;
  --blue-mid:    #1A3A5C;
  --blue-steel:  #2C5F8A;
  --blue-light:  #4A90C4;
  --blue-pale:   #EBF4FF;
  --teal:        #1A7A8A;
  --teal-light:  #E0F4F7;
  --white:       #FFFFFF;
  --off-white:   #F8F9FB;
  --cream:       #F4F5F0;
  --gray-100:    #F1F3F5;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-900:    #111827;
  --green-ok:    #10B981;
  --red-err:     #EF4444;

  /* Typography */
  --font-main:   'Outfit', sans-serif;
  --font-serif:  'Lora', serif;

  /* Spacing & shape */
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   24px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background: var(--off-white);
  color: var(--gray-900);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===================== NAVBAR ===================== */
.rxly-navbar {
  background: var(--blue-dark);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 999;
  gap: 24px;
}
.rxly-navbar .logo-wrap { flex: 1; }
.rxly-navbar .logo-wrap img { height: 44px; }
.rxly-navbar .nav-center { display: flex; gap: 4px; }
.rxly-navbar .nav-pill {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 400;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.rxly-navbar .nav-pill:hover { color: white; background: rgba(255,255,255,0.08); }
.rxly-navbar .nav-pill.active { color: white; background: rgba(255,255,255,0.12); }
.rxly-navbar .nav-right { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switch {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}
.lang-switch a {
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.18s;
  letter-spacing: 0.5px;
}
.lang-switch a.active-lang { background: white; color: var(--blue-dark); font-weight: 600; }
.lang-switch a:hover:not(.active-lang) { color: white; }

/* User menu */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: all 0.2s;
}
.nav-user:hover { background: rgba(255,255,255,0.14); color: white; }
.nav-user .avatar {
  width: 26px; height: 26px;
  background: var(--blue-steel);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: white;
}
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  min-width: 180px; overflow: hidden;
  display: none;
}
.nav-user:focus .nav-dropdown,
.nav-user-wrap:hover .nav-dropdown { display: block; }
.nav-dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 13px; color: var(--gray-600);
  text-decoration: none; transition: background 0.15s;
}
.nav-dropdown a:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-dropdown .divider { height: 1px; background: var(--gray-200); margin: 4px 0; }
.nav-dropdown .danger { color: var(--red-err); }
.nav-dropdown .danger:hover { background: #FEF2F2; }

/* ===================== LAYOUT ===================== */
.app-shell { display: flex; min-height: calc(100vh - 64px); }

/* ===================== SIDEBAR ===================== */
.rxly-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--gray-200);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
}
.sidebar-group { margin-bottom: 6px; }
.sidebar-group-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.9px;
  text-transform: uppercase;
  padding: 8px 12px 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.sidebar-link i { width: 16px; font-size: 14px; flex-shrink: 0; }
.sidebar-link:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-link.active { background: var(--blue-pale); color: var(--blue-mid); font-weight: 500; }
.sidebar-link.active i { color: var(--blue-steel); }
.sidebar-link.danger { color: var(--red-err); }
.sidebar-link.danger:hover { background: #FEF2F2; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--gray-200); padding-top: 12px; }

/* ===================== MAIN ===================== */
.rxly-main { flex: 1; padding: 36px 40px; overflow-y: auto; max-width: 1100px; }
.page-header { margin-bottom: 28px; }
.page-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.page-sub { font-size: 14px; color: var(--gray-400); }

/* ===================== CARDS ===================== */
.rxly-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.rxly-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
}
.rxly-card-header .card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-900);
}
.rxly-card-header .card-icon {
  width: 32px; height: 32px;
  background: var(--blue-pale);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-steel);
  font-size: 14px;
}
.rxly-card-body { padding: 24px; }

/* ===================== STATS ===================== */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: 12px; color: var(--gray-400); font-weight: 500; letter-spacing: 0.3px; margin-bottom: 8px; text-transform: uppercase; }
.stat-card .stat-value { font-family: var(--font-serif); font-size: 32px; font-weight: 600; color: var(--gray-900); line-height: 1; }
.stat-card .stat-icon { float: right; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.stat-card.blue .stat-icon { background: var(--blue-pale); color: var(--blue-steel); }
.stat-card.teal .stat-icon { background: var(--teal-light); color: var(--teal); }
.stat-card.green .stat-icon { background: #D1FAE5; color: #059669; }

/* ===================== TABLES ===================== */
.rxly-table { width: 100%; border-collapse: collapse; }
.rxly-table th {
  font-size: 11px; font-weight: 600; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-100);
}
.rxly-table td {
  padding: 14px 16px; font-size: 13.5px;
  color: var(--gray-600); border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.rxly-table tr:hover td { background: var(--gray-100); }
.rxly-table tr:last-child td { border-bottom: none; }
.rxly-table .td-main { color: var(--gray-900); font-weight: 500; }

/* ===================== BADGES ===================== */
.badge-rxly {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
}
.badge-sent { background: var(--blue-pale); color: var(--blue-mid); }
.badge-validated { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: var(--gray-100); color: var(--gray-400); }

/* ===================== BUTTONS ===================== */
.btn-rxly {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-main); font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; text-decoration: none;
  transition: all 0.18s; letter-spacing: 0.2px;
}
.btn-primary-rxly { background: var(--blue-dark); color: white; }
.btn-primary-rxly:hover { background: var(--blue-mid); color: white; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,22,40,0.25); }
.btn-outline-rxly { background: transparent; color: var(--blue-mid); border: 1.5px solid var(--blue-mid); }
.btn-outline-rxly:hover { background: var(--blue-pale); }
.btn-danger-rxly { background: transparent; color: var(--red-err); border: 1.5px solid var(--red-err); }
.btn-danger-rxly:hover { background: #FEF2F2; }
.btn-success-rxly { background: var(--green-ok); color: white; }
.btn-success-rxly:hover { background: #059669; color: white; }
.btn-sm-rxly { padding: 6px 12px; font-size: 12.5px; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 20px; }
.form-label-rxly {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--gray-600); margin-bottom: 6px;
}
.form-control-rxly {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-main); font-size: 14px;
  color: var(--gray-900); background: white;
  transition: all 0.18s; outline: none;
}
.form-control-rxly:focus { border-color: var(--blue-steel); box-shadow: 0 0 0 3px rgba(44,95,138,0.1); }
.form-control-rxly::placeholder { color: var(--gray-400); }
select.form-control-rxly { cursor: pointer; }
textarea.form-control-rxly { resize: vertical; min-height: 90px; }

/* ===================== UPLOAD ZONE ===================== */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: var(--gray-100);
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--blue-steel); background: var(--blue-pale); }
.upload-zone .upload-icon { font-size: 32px; color: var(--gray-400); margin-bottom: 12px; }
.upload-zone .upload-text { font-size: 14px; color: var(--gray-600); }
.upload-zone .upload-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.upload-zone input[type="file"] { display: none; }

/* ===================== AUTH PAGES ===================== */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-left {
  background: var(--blue-dark);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: var(--blue-mid);
  border-radius: 50%;
  opacity: 0.3;
}
.auth-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: var(--blue-steel);
  border-radius: 50%;
  opacity: 0.2;
}
.auth-left-content { position: relative; z-index: 1; }
.auth-tagline {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
  margin: 48px 0 24px;
}
.auth-tagline span { color: rgba(255,255,255,0.5); }
.auth-features { list-style: none; padding: 0; }
.auth-features li {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.75); font-size: 14px;
  margin-bottom: 14px;
}
.auth-features li .feat-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: white;
}
.auth-footer-text { color: rgba(255,255,255,0.35); font-size: 12px; position: relative; z-index: 1; }

.auth-right {
  background: white;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-right .auth-logo { margin-bottom: 40px; }
.auth-right .auth-logo img { height: 40px; }
.auth-form-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.auth-form-sub { font-size: 14px; color: var(--gray-400); margin-bottom: 32px; }
.auth-form { max-width: 400px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}
.auth-divider span { font-size: 12px; color: var(--gray-400); white-space: nowrap; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px; color: var(--gray-600);
  font-family: var(--font-main); font-weight: 400;
  background: white; cursor: pointer;
  text-decoration: none; transition: all 0.18s;
  margin-bottom: 10px;
}
.oauth-btn:hover { border-color: var(--gray-400); color: var(--gray-900); background: var(--gray-100); }
.oauth-btn img { width: 18px; height: 18px; }
.auth-switch { font-size: 13px; color: var(--gray-400); margin-top: 24px; }
.auth-switch a { color: var(--blue-steel); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

/* ===================== ALERTS ===================== */
.rxly-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
}
.rxly-alert.success { background: #D1FAE5; color: #065F46; border-left: 3px solid #10B981; }
.rxly-alert.danger  { background: #FEE2E2; color: #991B1B; border-left: 3px solid #EF4444; }
.rxly-alert.info    { background: var(--blue-pale); color: var(--blue-mid); border-left: 3px solid var(--blue-light); }
.rxly-alert.warning { background: #FEF3C7; color: #92400E; border-left: 3px solid #F59E0B; }
.rxly-alert .alert-close { margin-left: auto; cursor: pointer; opacity: 0.6; background: none; border: none; font-size: 16px; }

/* ===================== PAGINATION ===================== */
.rxly-pagination { display: flex; align-items: center; gap: 4px; padding: 16px 0; }
.page-btn {
  padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: 13px; border: 1px solid var(--gray-200);
  background: white; color: var(--gray-600);
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.page-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.page-btn.active { background: var(--blue-dark); color: white; border-color: var(--blue-dark); }
.page-btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state .empty-title { font-size: 16px; font-weight: 500; color: var(--gray-600); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13.5px; }

/* ===================== MODAL ===================== */
.rxly-modal .modal-content {
  border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.rxly-modal .modal-header {
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 24px;
}
.rxly-modal .modal-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; }
.rxly-modal .modal-body { padding: 24px; }
.rxly-modal .modal-footer { border-top: 1px solid var(--gray-200); padding: 16px 24px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .rxly-sidebar { display: none; }
  .rxly-main { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .rxly-navbar { padding: 0 16px; }
}
