/* WFsign Panel — Blue mobile-only app shell (2026-12-05)
   The panel is intentionally a phone-first canvas at every viewport width. */

html {
    background: #0b3d7a;
}

body {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    font-family: "Cairo", "SF Arabic", "Geeza Pro", "Segoe UI", Tahoma, Arial, sans-serif;
    background:
        radial-gradient(520px 340px at 92% -8%, rgba(30, 90, 168, 0.18), transparent 62%),
        radial-gradient(480px 320px at 0% 108%, rgba(11, 61, 122, 0.12), transparent 58%),
        linear-gradient(160deg, #f7faff, #eef5ff 55%, #dce9fb);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 24px 80px rgba(7, 43, 87, 0.32);
}

.layout {
    display: block;
    height: 100vh;
    height: 100dvh;
}

.sidebar {
    display: none !important;
}

.main {
    width: 100%;
    max-width: 560px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
}

.main-header {
    margin: 10px 12px 0;
    padding: 10px 12px;
    border-radius: 18px;
    border-color: rgba(30, 90, 168, 0.16);
    background:
        linear-gradient(135deg, #ffffff, #f2f7ff),
        radial-gradient(360px 150px at 95% 0%, rgba(30, 90, 168, 0.12), transparent 65%);
}

.main-header-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
}

.main-header-brand {
    gap: 9px;
}

.main-header-brand strong {
    font-size: 16px;
}

.main-header-brand small {
    max-width: 190px;
    font-size: 10px;
}

.main-header-actions {
    gap: 6px;
    flex-wrap: nowrap;
}

.main-header-actions .live-pill,
.main-header-actions .store-link {
    display: none;
}

.main-header-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
}

.mobile-logout {
    display: inline-flex;
}

.mobile-logout .btn.danger {
    border-color: #0b3d7a;
    background: #0b3d7a;
}

.main-scroll {
    padding: 12px 12px calc(92px + env(safe-area-inset-bottom));
}

.topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 2px 2px 12px;
    margin-bottom: 12px;
}

.topbar h2 {
    font-size: 22px;
}

.topbar p {
    font-size: 12px;
    line-height: 1.7;
}

.topbar .actions {
    width: 100%;
}

.topbar .actions .btn {
    flex: 1 1 0;
}

.grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(16, 35, 63, 0.08);
}

.card h3 {
    font-size: 16px;
}

.card .hint {
    font-size: 12px;
}

.stat strong {
    font-size: 26px;
}

.stat > div:first-child {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.stat strong {
    line-height: 1;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
}

table {
    display: block;
    min-width: 0;
    width: 100%;
}

table thead {
    display: none;
}

table tbody,
table tr {
    display: block;
    width: 100%;
}

table td {
    display: flex;
    width: 100%;
}

table tr {
    padding: 9px 2px;
    border-bottom: 1px solid var(--line);
}

table tr:last-child {
    border-bottom: 0;
}

table tbody th {
    display: block;
    padding: 0 2px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
}

th,
td {
    padding: 5px 2px;
    font-size: 12px;
}

td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    text-align: right;
}

td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

td.ltr {
    text-align: left;
    word-break: break-all;
}

td.ltr::before {
    text-align: right;
}

td > div {
    margin-inline-start: auto;
}

.btn {
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 14px;
}

.btn.small {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
}

input,
select,
textarea {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 16px;
}

input[type="file"] {
    min-height: 0;
    padding: 8px;
    border: 1px dashed #9ec3f5;
    background: #f2f7ff;
    color: var(--muted);
    font-size: 12px;
}

input[type="file"]::file-selector-button {
    margin-inline-end: 8px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: #0b3d7a;
    color: #ffffff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

textarea {
    min-height: 100px;
}

.form-row {
    grid-template-columns: 1fr;
    gap: 10px;
}

label {
    font-size: 13px;
}

.actions {
    gap: 7px;
}

.login-wrap {
    height: 100vh;
    height: 100dvh;
    padding: 14px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 22px;
}

.login-card .brand {
    padding-bottom: 14px;
    margin-bottom: 14px;
}

.login-card h2 {
    font-size: 23px;
}

.source-row {
    gap: 9px;
}

.source-list-row {
    flex-wrap: wrap;
    align-items: flex-start;
}

.source-list-row > div:first-child {
    flex: 1 1 100%;
    align-items: flex-start !important;
}

.source-list-row > div:first-child > div {
    min-width: 0;
}

.source-list-row .source-icon {
    flex: 0 0 auto;
}

.source-list-row .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.source-list-row .actions .btn,
.source-list-row .actions form,
.source-list-row .actions form .btn {
    width: 100%;
}

.source-list-row .actions form:last-child {
    grid-column: 1 / -1;
}

.mobile-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: min(100%, 560px);
    z-index: 60;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(30, 90, 168, 0.18);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    box-shadow: 0 -10px 30px rgba(16, 35, 63, 0.12);
}

.mobile-nav a {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 6px 2px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
}

.mobile-nav a.active {
    color: #ffffff;
    background: linear-gradient(135deg, #0b3d7a, #1e5aa8);
}

.mobile-nav svg {
    width: 19px;
    height: 19px;
}

.mobile-nav span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .mobile-nav a {
        font-size: 8px;
    }

    .main-header-brand small {
        max-width: 145px;
    }

    .main-header-actions .btn {
        padding: 6px 8px;
    }

    .main-scroll {
        padding-inline: 10px;
    }
}
