:root{color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,sans-serif;background:#0b1220;color:#eef3ff}*{box-sizing:border-box}body{margin:0}header{height:82px;border-bottom:1px solid #25324a;display:flex;align-items:center;justify-content:space-between;padding:0 max(24px,5vw)}a{color:#75c5ff}header a{text-decoration:none}header nav{display:flex;gap:24px}.brand{font-size:23px;font-weight:800;color:#f6f9ff}.brand small{color:#66e2c2;font-size:12px}main{max-width:1320px;margin:36px auto;padding:0 24px}.card{background:#18243a;border:1px solid #263853;border-radius:18px;padding:24px;margin-bottom:20px;box-shadow:0 8px 26px #0002}.narrow{max-width:530px;margin:50px auto}h1{font-size:32px;margin:8px 0}h2{font-size:21px;margin:0 0 18px}p,.muted{color:#aabbd2}.eyebrow{font-size:11px;letter-spacing:2px;color:#6edbc5;font-weight:800}.titlebar{display:flex;justify-content:space-between;align-items:center;gap:15px}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0}.stats .card{margin:0}.stats span{display:block;color:#aabbd2}.stats strong{font-size:30px;display:block;margin-top:12px}.scroll{overflow-x:auto}table{width:100%;border-collapse:collapse;min-width:750px}th,td{text-align:left;border-bottom:1px solid #344158;padding:13px 9px;font-size:13px}th{color:#9fb5cf}td{vertical-align:middle}.pill{display:inline-block;border:1px solid #53617a;border-radius:50px;padding:4px 9px;font-size:12px}.pill.approved{color:#62e4b2;border-color:#23795f}.pill.pending{color:#f6c96b;border-color:#8c6b26}.pill.revoked,.pill.denied{color:#f78e9e;border-color:#87404c}button,.button{display:inline-block;background:#307ee6;color:white;border:0;border-radius:9px;padding:11px 16px;cursor:pointer;text-decoration:none;font-weight:700}button:hover,.button:hover{filter:brightness(1.15)}.ghost{background:#34465e}.small{font-size:12px;padding:7px 9px}.danger{background:#853c4e}.actions{display:flex;gap:5px;flex-wrap:wrap}form label{display:block;color:#b9c8da;margin:16px 0}input,select{display:block;width:100%;background:#101c2f;border:1px solid #40516b;color:white;border-radius:9px;padding:12px;margin-top:6px}form>button{margin-top:12px}.error{color:#ff9fa8}.filters{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.filters input,.filters select{width:auto;min-width:200px}.metric{background:#101c2f;text-align:left}.metric strong{font-size:26px}.group{background:#101c2f;border:1px solid #2c3a52;border-radius:12px;margin:9px 0;padding:12px}.group summary{cursor:pointer}.group .entry{padding:7px;border-top:1px solid #263853;font-size:12px;color:#b5c4d9;word-break:break-word}code{word-break:break-word;color:#a4e1ff}img{max-width:100%}@media(max-width:700px){.stats{grid-template-columns:repeat(2,1fr)}.titlebar{align-items:flex-start;flex-direction:column}.filters input,.filters select{width:100%}}

/* ===== V2 Enrollment Page ===== */

.enrollment-page {
  max-width: 1120px;
  margin: 35px auto 70px;
}

.enrollment-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 38px;
}

.enrollment-heading h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  margin: 14px 0;
}

.enrollment-heading p {
  font-size: 16px;
  line-height: 1.7;
}

.enrollment-badge {
  display: inline-block;
  color: #6ee7c8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
}

.enrollment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}

.enrollment-form-card {
  padding: 30px;
}

.enrollment-section-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.enrollment-section-heading h2 {
  margin: 0 0 5px;
}

.enrollment-section-heading p {
  margin: 0;
  font-size: 13px;
}

.enrollment-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #173c55;
  color: #72e5ce;
  font-weight: 800;
}

.enrollment-fields label {
  font-size: 14px;
  font-weight: 600;
}

.enrollment-fields input {
  margin-top: 9px;
  min-height: 46px;
}

.enrollment-fields input:focus {
  outline: none;
  border-color: #66c9ff;
  box-shadow: 0 0 0 3px #66c9ff20;
}

.enrollment-profile-section {
  margin-top: 30px;
}

.enrollment-profile-section h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.enrollment-profile-section > p {
  font-size: 13px;
  margin-bottom: 16px;
}

.enrollment-profile-options {
  display: grid;
  gap: 12px;
}

.enrollment-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 17px;
  margin: 0;
  border: 1px solid #34465f;
  border-radius: 12px;
  background: #111e32;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.enrollment-profile:hover {
  border-color: #5a91d5;
}

.enrollment-profile:has(input:checked) {
  border-color: #438cf0;
  background: #172c49;
}

.enrollment-profile input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #438cf0;
}

.enrollment-profile-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.enrollment-profile-content strong {
  color: #eef3ff;
  font-size: 14px;
}

.enrollment-profile-content small {
  color: #9eb2cc;
  line-height: 1.5;
}

.enrollment-submit {
  width: 100%;
  margin-top: 28px;
  padding: 15px;
  font-size: 14px;
}

.enrollment-privacy {
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
  margin: 16px 0 0;
}

.enrollment-sidebar {
  display: grid;
  gap: 18px;
}

.enrollment-info-card,
.enrollment-security-card {
  padding: 26px;
}

.enrollment-info-card h2 {
  margin-top: 13px;
  font-size: 21px;
}

.enrollment-info-step {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.enrollment-info-step > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #203b59;
  color: #80c9ff;
  font-weight: 800;
}

.enrollment-info-step strong {
  font-size: 14px;
}

.enrollment-info-step p {
  font-size: 12px;
  line-height: 1.6;
  margin: 6px 0 0;
}

.enrollment-security-card {
  background: linear-gradient(135deg, #163c3c, #18243a);
}

.enrollment-security-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #1c6456;
  color: #8fffdc;
  font-size: 22px;
  font-weight: 800;
}

.enrollment-security-card h3 {
  margin: 18px 0 10px;
}

.enrollment-security-card p {
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 850px) {
  .enrollment-layout {
    grid-template-columns: 1fr;
  }

  .enrollment-sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .enrollment-page {
    margin-top: 15px;
  }

  .enrollment-form-card,
  .enrollment-info-card,
  .enrollment-security-card {
    padding: 20px;
  }

  .enrollment-heading {
    margin-bottom: 25px;
  }
}

/* ==========================================
   AlMosawi V2 Admin Layout
========================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: #0e0f12;
}

.admin-sidebar {
    width: 220px;
    min-width: 220px;
    background: #101114;
    border-right: 1px solid #303137;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 16px 8px 28px;
}

.sidebar-brand strong {
    display: block;
    font-size: 16px;
    color: #ffffff;
}

.sidebar-brand span {
    display: block;
    font-size: 12px;
    color: #a6a8b3;
    margin-top: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-nav a {
    display: block;
    padding: 12px;
    border-radius: 8px;
    color: #e8e9ef;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav a:hover {
    background: #252832;
}

.sidebar-nav a.active {
    background: #496ef2;
    color: white;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 8px;
    font-size: 11px;
    color: #858894;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-width: 0;
        padding: 12px;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar-nav a {
        white-space: nowrap;
    }

    .sidebar-footer {
        display: none;
    }

    .admin-main {
        padding: 20px;
    }
}

/* Enrollment request actions */

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.actions form {
    margin: 0;
}

.actions button {
    cursor: pointer;
}

.actions button.danger {
    background: #dc3545;
    color: #fff;
    border: 1px solid #dc3545;
}

.actions button.danger:hover {
    background: #b91c1c;
}

.pill.approved {
    color: #4ade80;
}

.pill.denied {
    color: #fb7185;
}

/* Enrollment device type */

.enrollment-profile-section select,
.enrollment-card select,
form select[name="device_type"] {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    margin-top: 8px;
    background: #101e31;
    color: #f1f5ff;
    border: 1px solid #40516b;
    border-radius: 9px;
    font: inherit;
    cursor: pointer;
}

form select[name="device_type"]:focus {
    outline: none;
    border-color: #3184ef;
}

form select[name="device_type"] option {
    background: #101e31;
    color: #f1f5ff;
}

/* AlMosawi DNS Overview */

.overview-section {
    margin-top: 24px;
}

.overview-section h2 {
    margin-bottom: 18px;
}

.overview-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-history {
    margin-top: 20px;
    border-top: 1px solid #334155;
    padding-top: 16px;
}

.overview-history summary {
    cursor: pointer;
    color: #cbd5e1;
    font-weight: 600;
}

.overview-history .scroll {
    margin-top: 16px;
}

.overview-device-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.overview-device-card {
    min-width: 0;
}

.overview-device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.overview-device-header h3 {
    margin: 0;
    overflow-wrap: anywhere;
}

.overview-identifiers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
}

.overview-identifiers code {
    overflow-wrap: anywhere;
    color: #7dd3fc;
}

.overview-device-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #334155;
    padding-top: 14px;
}

.overview-device-footer strong {
    font-size: 13px;
}

@media (max-width: 900px) {
    .overview-device-grid,
    .overview-stats {
        grid-template-columns: 1fr;
    }
}


/* Unified AlMosawi DNS Activity styling */

body .dns-activity-page {
    color: #e5edf9;
}

body .dns-activity-page .card,
body .dns-activity-page .dns-card,
body .dns-activity-page .activity-card {
    background: #19263d;
    border: 1px solid #283f60;
    border-radius: 18px;
    box-shadow: none;
}

body .dns-activity-page input,
body .dns-activity-page select {
    background: #101e31;
    color: #e5edf9;
    border: 1px solid #40516b;
    border-radius: 9px;
}

body .dns-activity-page table,
body .dns-activity-page th,
body .dns-activity-page td {
    color: #e5edf9;
}

body .dns-activity-page button {
    border-radius: 9px;
}


/* Smaller buttons on Overview only */

.overview-compact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 7px;
    text-decoration: none;
    white-space: nowrap;
}


/* AlMosawi DNS - User Action Buttons */

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.user-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #2f80ed;
    color: #ffffff !important;

    border: 1px solid #3b82f6;
    border-radius: 7px;

    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;

    transition: background 0.2s ease;
}

.user-action-btn:hover {
    background: #1d4ed8;
}


/* AlMosawi DNS - Device Actions */

.device-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.device-actions a {
    display: inline-block;
    padding: 6px 11px;
    background: #263b5b;
    border: 1px solid #39557b;
    border-radius: 6px;
    color: #dbeafe;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.device-actions a:hover {
    background: #3478e5;
    color: white;
}

