/* ─── DAS Portal — BestPack Design System ────────────────────────────────── */
/* Version 1.0.0 | Industrial IoT Dashboard | BestPack */

/* ─── Custom Properties ──────────────────────────────────────────────────── */
:root {
    /* Brand */
    --red:          #C8102E;
    --red-dark:     #a50d25;
    --red-light:    #e8152f;

    /* Neutrals */
    --bg:           #0d0f14;
    --bg-card:      #161920;
    --bg-elevated:  #1e2230;
    --bg-input:     #12141a;
    --border:       #2a2e3d;
    --border-light: #363b50;

    /* Text */
    --text:         #e8eaf0;
    --text-muted:   #8b90a4;
    --text-faint:   #555b72;

    /* Status */
    --green:        #22c55e;
    --green-bg:     rgba(34,197,94,.12);
    --yellow:       #f59e0b;
    --yellow-bg:    rgba(245,158,11,.12);
    --orange:       #f97316;
    --orange-bg:    rgba(249,115,22,.12);
    --red-status:   #ef4444;
    --red-status-bg:rgba(239,68,68,.12);
    --blue:         #3b82f6;
    --blue-bg:      rgba(59,130,246,.12);

    /* Sizes */
    --nav-h:        64px;
    --sidebar-w:    240px;
    --radius:       8px;
    --radius-sm:    5px;
    --radius-lg:    12px;

    /* Shadows */
    --shadow:       0 4px 24px rgba(0,0,0,.4);
    --shadow-sm:    0 2px 8px rgba(0,0,0,.3);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-light); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.das-nav {
    height: var(--nav-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 2rem;
}
.das-nav__logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex-shrink: 0;
}
.das-nav__logo-mark {
    width: 32px;
    height: 32px;
    background: var(--red);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
}
.das-nav__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.das-nav__logo-text strong {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .3px;
}
.das-nav__logo-text span {
    font-size: .65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.das-nav__links {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex: 1;
}
.das-nav__link {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .15s, background .15s;
}
.das-nav__link:hover {
    color: var(--text);
    background: var(--bg-elevated);
}
.das-nav__link.active {
    color: var(--red);
    background: rgba(200,16,46,.1);
}
.das-nav__link svg { width: 15px; height: 15px; flex-shrink: 0; }
.das-nav__right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.das-nav__user {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    color: var(--text-muted);
}
.das-nav__avatar {
    width: 30px;
    height: 30px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    flex-shrink: 0;
}
.das-nav__company {
    font-size: .78rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.das-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.das-page {
    padding: 2rem 1.75rem;
    flex: 1;
}
.das-page--auth {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

/* ─── Page Header ─────────────────────────────────────────────────────────── */
.das-page-header {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.das-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
    line-height: 1.2;
}
.das-page-header__sub {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .3rem;
}
.das-page-header__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.das-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.das-card--sm { padding: 1rem 1.25rem; }
.das-card--tight { padding: .875rem 1rem; }
.das-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.das-card__header .das-card__title { margin-bottom: 0; }
.das-card__title {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.das-card__title::before {
    content: '';
    display: block;
    width: 3px;
    height: 14px;
    background: var(--red);
    border-radius: 2px;
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.das-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.das-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.das-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--red);
    opacity: .6;
}
.das-stat__label {
    font-size: .73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-muted);
    margin-bottom: .6rem;
}
.das-stat__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -1px;
}
.das-stat__sub {
    font-size: .75rem;
    color: var(--text-faint);
    margin-top: .4rem;
}
.das-stat--green .das-stat__value { color: var(--green); }
.das-stat--red .das-stat__value { color: var(--red-status); }
.das-stat--yellow .das-stat__value { color: var(--yellow); }
.das-stat--blue .das-stat__value { color: var(--blue); }

/* ─── Grids ──────────────────────────────────────────────────────────────── */
.das-grid { display: grid; gap: 1.25rem; }
.das-grid--2 { grid-template-columns: repeat(2, 1fr); }
.das-grid--3 { grid-template-columns: repeat(3, 1fr); }
.das-grid--4 { grid-template-columns: repeat(4, 1fr); }
.das-grid--auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 900px) {
    .das-grid--2, .das-grid--3, .das-grid--4 { grid-template-columns: 1fr; }
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.das-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .55rem 1.1rem;
    font-size: .82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}
.das-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.das-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.das-btn--primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.das-btn--primary:hover:not(:disabled) {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}

.das-btn--secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--border-light);
}
.das-btn--secondary:hover:not(:disabled) {
    background: var(--border);
    border-color: var(--border-light);
    color: var(--text);
}

.das-btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.das-btn--ghost:hover:not(:disabled) {
    color: var(--text);
    background: var(--bg-elevated);
}

.das-btn--danger {
    background: rgba(239,68,68,.1);
    color: var(--red-status);
    border-color: rgba(239,68,68,.25);
}
.das-btn--danger:hover:not(:disabled) {
    background: rgba(239,68,68,.2);
    color: var(--red-status);
}

.das-btn--success {
    background: rgba(34,197,94,.1);
    color: var(--green);
    border-color: rgba(34,197,94,.25);
}
.das-btn--success:hover:not(:disabled) {
    background: rgba(34,197,94,.2);
}

.das-btn--lg {
    padding: .75rem 1.5rem;
    font-size: .9rem;
    border-radius: var(--radius);
}
.das-btn--sm {
    padding: .3rem .7rem;
    font-size: .75rem;
}
.das-btn--full { width: 100%; }
.das-btn--loading { opacity: .7; pointer-events: none; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.das-form { display: flex; flex-direction: column; gap: 1rem; }
.das-field { display: flex; flex-direction: column; gap: .4rem; }
.das-field--row { flex-direction: row; align-items: center; gap: .75rem; }
.das-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.das-label .req { color: var(--red); margin-left: .2rem; }
.das-input, .das-select, .das-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    font-size: .875rem;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.das-input::placeholder, .das-textarea::placeholder { color: var(--text-faint); }
.das-input:focus, .das-select:focus, .das-textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(200,16,46,.15);
}
.das-input.error, .das-select.error, .das-textarea.error {
    border-color: var(--red-status);
}
.das-textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.das-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%238b90a4' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 14px;
    padding-right: 2.5rem;
    cursor: pointer;
}
.das-field-hint {
    font-size: .73rem;
    color: var(--text-faint);
    line-height: 1.4;
}
.das-field-error {
    font-size: .75rem;
    color: var(--red-status);
}

/* ─── Auth Forms ─────────────────────────────────────────────────────────── */
.das-auth-box {
    width: 100%;
    max-width: 440px;
}
.das-auth-box--wide { max-width: 680px; }
.das-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}
.das-auth-logo {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.das-auth-logo__mark {
    width: 44px;
    height: 44px;
    background: var(--red);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}
.das-auth-logo__text {
    text-align: left;
}
.das-auth-logo__text strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.das-auth-logo__text span {
    font-size: .7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.das-auth-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .4rem;
}
.das-auth-header p {
    font-size: .875rem;
    color: var(--text-muted);
}
.das-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .83rem;
    color: var(--text-muted);
}

/* ─── Alert / Toast ──────────────────────────────────────────────────────── */
.das-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .83rem;
    border: 1px solid transparent;
    line-height: 1.5;
}
.das-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: .05rem; }
.das-alert--error { background: var(--red-status-bg); border-color: rgba(239,68,68,.25); color: #fca5a5; }
.das-alert--success { background: var(--green-bg); border-color: rgba(34,197,94,.25); color: #86efac; }
.das-alert--warning { background: var(--yellow-bg); border-color: rgba(245,158,11,.25); color: #fcd34d; }
.das-alert--info { background: var(--blue-bg); border-color: rgba(59,130,246,.25); color: #93c5fd; }
.das-alert { display: none; }
.das-alert.visible { display: flex; }

/* Toast */
#das-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.das-toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .82rem;
    color: var(--text);
    box-shadow: var(--shadow);
    pointer-events: all;
    max-width: 320px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.das-toast.show { opacity: 1; transform: none; }
.das-toast--success { border-left: 3px solid var(--green); }
.das-toast--error   { border-left: 3px solid var(--red-status); }
.das-toast--warning { border-left: 3px solid var(--yellow); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.das-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.das-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
}
.das-table thead th {
    padding: .7rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.das-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.das-table tbody tr:last-child { border-bottom: none; }
.das-table tbody tr:hover { background: rgba(255,255,255,.02); }
.das-table td {
    padding: .85rem 1rem;
    color: var(--text);
    vertical-align: middle;
}
.das-table td.muted { color: var(--text-muted); }
.das-table td.mono { font-family: 'Courier New', monospace; font-size: .8rem; color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.das-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.das-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.das-badge--active   { background: var(--green-bg); color: var(--green); border-color: rgba(34,197,94,.2); }
.das-badge--pending  { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(245,158,11,.2); }
.das-badge--inactive { background: var(--bg-elevated); color: var(--text-faint); border-color: var(--border); }
.das-badge--error    { background: var(--red-status-bg); color: var(--red-status); border-color: rgba(239,68,68,.2); }
.das-badge--warning  { background: var(--orange-bg); color: var(--orange); border-color: rgba(249,115,22,.2); }
.das-badge--info     { background: var(--blue-bg); color: var(--blue); border-color: rgba(59,130,246,.2); }

/* ─── Machine Cards ──────────────────────────────────────────────────────── */
.das-machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.das-machine-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.das-machine-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}
.das-machine-card.active-alarm { border-color: rgba(239,68,68,.4); }
.das-machine-card.active-alarm::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--red-status);
}
.das-machine-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: .875rem;
    gap: .75rem;
}
.das-machine-card__icon {
    width: 38px;
    height: 38px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.das-machine-card__icon svg { width: 18px; height: 18px; color: var(--text-muted); }
.das-machine-card__serial {
    font-size: .73rem;
    color: var(--text-faint);
    font-family: 'Courier New', monospace;
    margin-bottom: .2rem;
}
.das-machine-card__name {
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}
.das-machine-card__meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-top: .875rem;
    padding-top: .875rem;
    border-top: 1px solid var(--border);
}
.das-machine-card__stat {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.das-machine-card__stat-label {
    font-size: .67rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-faint);
}
.das-machine-card__stat-value {
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
}

/* ─── Charts ─────────────────────────────────────────────────────────────── */
.das-chart-wrap {
    position: relative;
    height: 220px;
}
.das-chart-wrap--tall { height: 300px; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.das-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.das-modal-overlay.open { display: flex; }
.das-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.das-modal__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.das-modal__title { font-size: 1rem; font-weight: 700; color: var(--text); }
.das-modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: .2rem;
    line-height: 1;
    border-radius: 4px;
    transition: color .15s, background .15s;
}
.das-modal__close:hover { color: var(--text); background: var(--bg-elevated); }
.das-modal__body { padding: 1.5rem; }
.das-modal__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

/* ─── Loading ─────────────────────────────────────────────────────────────── */
.das-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: das-spin .7s linear infinite;
}
@keyframes das-spin { to { transform: rotate(360deg); } }

.das-skeleton {
    background: var(--bg-elevated);
    border-radius: 4px;
    animation: das-pulse 1.5s ease-in-out infinite;
}
@keyframes das-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.das-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-muted);
    font-size: .85rem;
}
.das-loading-state .das-spinner { width: 28px; height: 28px; }

.das-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 3rem;
    color: var(--text-muted);
    text-align: center;
}
.das-empty-state svg { width: 40px; height: 40px; opacity: .3; }
.das-empty-state p { font-size: .85rem; }

/* ─── Registration Review Panel ──────────────────────────────────────────── */
.das-reg-list { display: flex; flex-direction: column; gap: .75rem; }
.das-reg-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color .15s;
}
.das-reg-item:hover { border-color: var(--border-light); }
.das-reg-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.das-reg-item__name {
    font-weight: 600;
    color: var(--text);
    font-size: .92rem;
}
.das-reg-item__email {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .1rem;
}
.das-reg-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    margin-bottom: .875rem;
}
.das-reg-item__meta-row {
    display: flex;
    gap: .4rem;
    font-size: .8rem;
}
.das-reg-item__meta-label { color: var(--text-faint); }
.das-reg-item__meta-value { color: var(--text); }
.das-reg-item__serials {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .875rem;
}
.das-reg-item__serial-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .15rem .5rem;
    font-size: .73rem;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
}
.das-reg-item__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ─── Pending Page ───────────────────────────────────────────────────────── */
.das-pending-wrap {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.das-pending-box {
    text-align: center;
    max-width: 480px;
}
.das-pending-icon {
    width: 72px;
    height: 72px;
    background: var(--yellow-bg);
    border: 1px solid rgba(245,158,11,.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.das-pending-icon svg { width: 32px; height: 32px; color: var(--yellow); }
.das-pending-box h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .6rem;
}
.das-pending-box p {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: .75rem;
}

/* ─── Dashboard Metric Rows ──────────────────────────────────────────────── */
.das-metric-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
}
.das-metric-row__value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text);
}
.das-metric-row__unit {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.das-progress {
    height: 5px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}
.das-progress__bar {
    height: 100%;
    background: var(--red);
    border-radius: 4px;
    transition: width .4s ease;
}
.das-progress__bar--green { background: var(--green); }
.das-progress__bar--yellow { background: var(--yellow); }

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.das-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ─── Tag List ───────────────────────────────────────────────────────────── */
.das-tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.das-tag {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .15rem .55rem;
    font-size: .72rem;
    color: var(--text-muted);
}

/* ─── Alarm List ─────────────────────────────────────────────────────────── */
.das-alarm-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .875rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.das-alarm-row:last-child { border-bottom: none; }
.das-alarm-row:hover { background: rgba(255,255,255,.02); }
.das-alarm-row__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.das-alarm-row__dot--active { background: var(--red-status); box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.das-alarm-row__dot--clear  { background: var(--green); }
.das-alarm-row__dot--warn   { background: var(--yellow); }
.das-alarm-row__info { flex: 1; min-width: 0; }
.das-alarm-row__name { font-size: .85rem; font-weight: 500; color: var(--text); }
.das-alarm-row__machine { font-size: .75rem; color: var(--text-muted); }
.das-alarm-row__time { font-size: .75rem; color: var(--text-faint); white-space: nowrap; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.das-footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.das-footer__copy {
    font-size: .75rem;
    color: var(--text-faint);
}
.das-footer__links {
    display: flex;
    gap: 1rem;
}
.das-footer__links a {
    font-size: .75rem;
    color: var(--text-faint);
    text-decoration: none;
    transition: color .15s;
}
.das-footer__links a:hover { color: var(--text-muted); }

/* ─── Utility Classes ────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-sm  { font-size: .82rem; }
.text-xs  { font-size: .73rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-auto { margin-top: auto; }
.gap-sm  { gap: .5rem; }
.d-flex  { display: flex; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ─── Sidebar Layout ─────────────────────────────────────────────────────── */
.das-layout {
    display: flex;
    min-height: 100vh;
}

.das-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
}
.das-sidebar::-webkit-scrollbar { display: none; }

.das-sidebar__logo {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.1rem 1rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.das-sidebar__logo-mark {
    width: 30px; height: 30px;
    background: var(--red);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 800; color: #fff;
    letter-spacing: -.5px; flex-shrink: 0;
}
.das-sidebar__logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.das-sidebar__logo-text strong { font-size: .85rem; font-weight: 700; color: var(--text); }
.das-sidebar__logo-text span   { font-size: .6rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .9px; }

.das-sidebar__user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1rem .9rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.das-sidebar__avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
    border: 1px solid;
    flex-shrink: 0;
}
.das-sidebar__user-info { min-width: 0; }
.das-sidebar__user-name    { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.das-sidebar__user-company { font-size: .72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.das-sidebar__user-tier    { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }

.das-sidebar__nav {
    padding: .6rem .6rem 0;
    flex-shrink: 0;
}

.das-sidebar__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .83rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color .15s, background .15s;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    position: relative;
}
.das-sidebar__item:hover { color: var(--text); background: var(--bg-elevated); }
.das-sidebar__item--active {
    color: var(--text);
    background: rgba(200, 16, 46, .08);
}
.das-sidebar__item--active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--red);
    border-radius: 0 2px 2px 0;
}
.das-sidebar__item--locked { opacity: .6; }
.das-sidebar__item-icon { opacity: .55; flex-shrink: 0; }
.das-sidebar__item--active .das-sidebar__item-icon,
.das-sidebar__item:hover   .das-sidebar__item-icon { opacity: 1; }
.das-sidebar__item--btn { font-family: inherit; }
.das-sidebar__lock { margin-left: auto; flex-shrink: 0; }

.das-sidebar__spacer { flex: 1; }

.das-sidebar__bottom {
    padding: .6rem .6rem .75rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.das-sidebar__divider {
    height: 1px;
    background: var(--border);
    margin: .5rem .15rem;
}

/* ─── Main content area ──────────────────────────────────────────────────── */
.das-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.das-topbar {
    height: 44px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}
.das-topbar__title {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ─── Page Tab Navigation (in-page tabs, e.g. Account) ──────────────────── */
.das-sub-nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.75rem;
}
.das-sub-nav__link {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem .9rem;
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.das-sub-nav__link:hover { color: var(--text); }
.das-sub-nav__link--active,
.das-sub-nav__link.active {
    color: var(--text);
    border-bottom-color: var(--red);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .das-sidebar { width: 200px; --sidebar-w: 200px; }
}
@media (max-width: 768px) {
    .das-nav { padding: 0 1rem; }
    .das-nav__company { display: none; }
    .das-nav__link span { display: none; }
    .das-sidebar { display: none; }
    .das-main { min-height: 100vh; }
    .das-page { padding: 1.25rem 1rem; }
    .das-stats { grid-template-columns: repeat(2, 1fr); }
    .das-auth-box { max-width: 100%; }
    .das-modal { max-width: 100%; max-height: 100vh; border-radius: var(--radius); }
}
@media (max-width: 480px) {
    .das-stats { grid-template-columns: 1fr 1fr; }
    .das-page-header { flex-direction: column; }
    .das-machine-grid { grid-template-columns: 1fr; }
}
