:root {
    --ui-bg-soft: linear-gradient(135deg, #f4f7fa 0%, #eef4f8 58%, #f7f6f3 100%);
    --ui-card-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    --ui-card-shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.06);
    --ui-ring: 0 0 0 3px rgba(77, 210, 229, 0.22);
}

body {
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--ui-bg-soft), var(--gt-bg);
}

.panel {
    border: 1px solid #d7e0ea;
    box-shadow: var(--ui-card-shadow-soft);
    border-radius: 14px !important;
}

.gt-alert,
.gt-alert p,
.gt-alert li,
.gt-alert a,
.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-select,
.swal2-textarea,
.swal2-validation-message,
.swal2-confirm,
.swal2-cancel,
.swal2-deny {
    font-size: 14px !important;
}

.gt-alert {
    line-height: 1.45;
}

.sidebar {
    background: linear-gradient(180deg, #1b4e79 0%, #174a74 42%, #15446d 100%);
    border-right-color: rgba(255, 255, 255, 0.12) !important;
}

.brand {
    padding: 10px 10px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #dce7f3;
    box-shadow: 0 8px 20px rgba(8, 29, 52, 0.24);
}

.nav {
    margin-top: 12px;
}

.nav a,
.nav .nav-action-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #d8e7f5 !important;
}

.nav a:hover,
.nav .nav-action-link:hover {
    transform: translateX(2px);
    border-color: rgba(137, 196, 236, 0.34);
    background: rgba(120, 184, 226, 0.22) !important;
    color: #f1f8ff !important;
}

.nav a.active {
    border-color: rgba(122, 190, 235, 0.42);
    box-shadow: inset 0 0 0 1px rgba(88, 166, 221, 0.24);
    background: linear-gradient(90deg, rgba(81, 150, 201, 0.58) 0%, rgba(60, 125, 173, 0.42) 100%) !important;
    color: #ffffff !important;
}

.nav-icon,
.hi {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 18px;
}

.nav a .nav-icon svg,
.nav .nav-action-link .nav-icon svg,
.hi svg,
.section-icon svg,
.topbar-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav .nav-icon {
    color: #d8e7f5;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon,
.nav .nav-action-link:hover .nav-icon {
    color: #ffffff;
}

.topbar {
    background: #eaf4fb !important;
    border: 1px solid #d8e4ef;
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: var(--ui-card-shadow-soft);
}

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

.pill {
    border: 1px solid #d9e4db;
    background: #f7faf4;
    font-weight: 600 !important;
    font-size: 12px !important;
}

input,
select,
textarea {
    border-color: #c8d5e1;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    background: #fff;
    font-size: 13.5px !important;
    min-height: 38px;
    padding: 8px 11px !important;
    border-radius: 10px !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #67aacd;
    box-shadow: var(--ui-ring);
    outline: none;
}

button {
    background: linear-gradient(180deg, #ff611f 0%, #f63f00 100%);
    border-color: #e23e05;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
    font-weight: 600 !important;
    letter-spacing: .1px;
    font-size: 13.5px;
    padding: 8px 12px;
    border-radius: 10px;
    line-height: 1.2;
}

button:hover {
    filter: brightness(.98);
}

.status {
    border: 1px solid #d3dce6;
    background: #f4f7fb;
    color: #445669;
    font-weight: 600 !important;
}

.status[data-status="active"],
.status[data-status="approved"],
.status[data-status="completed"] {
    background: #edf8f0;
    border-color: #c8e4d0;
    color: #1f6a3a;
}

.status[data-status="inactive"],
.status[data-status="not_invited"] {
    background: #f1f4f7;
    border-color: #d5dde5;
    color: #566879;
}

.status[data-status="assigned"],
.status[data-status="in_progress"] {
    background: #eef6ff;
    border-color: #c9def5;
    color: #235f93;
}

.status[data-status="available"],
.status[data-status="submitted"] {
    background: #eef8fb;
    border-color: #c6e1eb;
    color: #256077;
}

.status[data-status="in_review"] {
    background: #fff4cc;
    border-color: #f0d36a;
    color: #8a6500;
}

.status[data-status="quote_requested"],
.status[data-status="pending_approval"],
.status[data-status="invitation_pending"] {
    background: #fff7ea;
    border-color: #efd9b8;
    color: #8a5b18;
}

.status[data-status="quote_received"] {
    background: #f0f6ff;
    border-color: #cbdcf5;
    color: #2b5e91;
}

.status[data-status="closed"],
.status[data-status="read"] {
    background: #eef1f5;
    border-color: #d3d9e2;
    color: #4e5f72;
}

.status[data-status="unread"] {
    background: #ecf5ff;
    border-color: #c7dcf6;
    color: #245f92;
}

.status[data-status="canceled"],
.status[data-status="reject"],
.status[data-status="rejected"],
.status[data-status="lost"] {
    background: #fff1f1;
    border-color: #e8c6c6;
    color: #8b2f2f;
}

.status[data-status="damaged"],
.status[data-status="in_repair"] {
    background: #fff4ec;
    border-color: #efcfb8;
    color: #8a4e1f;
}

th {
    font-weight: 600 !important;
    font-size: 11.5px !important;
    letter-spacing: .35px !important;
    color: #496174 !important;
    background: linear-gradient(180deg, #f5f9fd 0%, #ecf3f9 100%);
    border-top: 1px solid #d7e2ec !important;
    border-bottom: 1px solid #d2dee9 !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

label {
    font-weight: 600 !important;
    font-size: 13px !important;
}

/* Softer CTA look for inline action links styled as buttons */
.filters a[style*="font-weight:700"],
.filters a[style*="font-weight: 700"] {
    font-weight: 600 !important;
}

.filters {
    gap: 10px !important;
    align-items: center;
}

.filters input,
.filters select,
.filters button,
.filters a {
    min-height: 38px;
}

.filters input {
    min-width: 240px;
    flex: 1 1 260px;
}

.filters select {
    min-width: 160px;
}

.filters .btn-add {
    margin-left: auto;
}

/* Normalize inline anchor-buttons used across legacy views */
a[style*="display:inline-block"][style*="border-radius:9px"],
a[style*="display:inline-block"][style*="border-radius: 9px"] {
    font-weight: 600 !important;
    font-size: 13.5px !important;
    letter-spacing: .1px;
    border-radius: 11px !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10);
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
}

a[style*="background:#1f6d57"],
a[style*="background: #1f6d57"] {
    background: linear-gradient(180deg, #25846a 0%, #1f6d57 100%) !important;
    border: 1px solid #1b614d !important;
}

a[style*="background:#fff"],
a[style*="background: #fff"] {
    border-color: #ced9e4 !important;
    box-shadow: none !important;
}

.form-shell {
    background: #fff;
    border: 1px solid #d7e0ea;
    border-radius: 18px;
    box-shadow: var(--ui-card-shadow);
    overflow: hidden;
}

.form-shell .form-head {
    padding: 24px 24px 20px;
    border-bottom: 1px solid #e2ebf3;
    background: linear-gradient(120deg, #eff8fd 0%, #ffffff 100%);
}

.form-shell .form-content {
    padding: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #223748;
}

.section-icon {
    width: 22px;
    height: 22px;
    color: #2a6d93;
}

.plans-grid .plan-card {
    --plan-bg: #5ea3e9;
    --plan-bg-strong: #1f5f9e;
    box-shadow: var(--ui-card-shadow-soft);
    border-color: transparent;
    background: var(--plan-bg);
    color: #ffffff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.plans-grid .plan-card:nth-child(3n+1) { --plan-bg: #5ea3e9; --plan-bg-strong: #1f5f9e; }
.plans-grid .plan-card:nth-child(3n+2) { --plan-bg: #40d0be; --plan-bg-strong: #117e70; }
.plans-grid .plan-card:nth-child(3n+3) { --plan-bg: #f2be67; --plan-bg-strong: #b87416; }
.plans-grid .plan-card[data-plan="starter"] { --plan-bg: #40d0be; --plan-bg-strong: #117e70; }
.plans-grid .plan-card[data-plan="pro"] { --plan-bg: #5ea3e9; --plan-bg-strong: #1f5f9e; }

.plans-grid .plan-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-card-shadow);
}

.plans-grid .plan-card.selected {
    background: var(--plan-bg-strong);
    border-color: #f63f00;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.16), var(--ui-card-shadow-soft);
}

.plans-grid .plan-card .name,
.plans-grid .plan-card .price,
.plans-grid .plan-card .muted {
    color: #ffffff;
}

.plans-grid .plan-card .price {
    opacity: 0.95;
}

.plans-grid .plan-card .muted {
    opacity: 0.9;
}

.detail {
    border-color: #cfe0eb;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
}

.brand-logo-panel {
    box-shadow: var(--ui-card-shadow);
    border-radius: 18px;
}

.brand-logo-panel--full {
    width: 100%;
    justify-content: center;
    padding: 20px 12px;
}

.brand-logo-image--register {
    width: auto;
    height: 70px;
    max-width: min(250px, 60vw);
}

.portal-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #d9e4ef;
    border-radius: 14px;
    background: linear-gradient(90deg, #ecf7fc 0%, #fef6ef 100%);
}

/* Dashboard refresh */
.dash-header {
    border: 1px solid #d7e5f0;
    border-radius: 16px;
    background: linear-gradient(100deg, #e9f4fa 0%, #f4faff 48%, #fff4eb 100%);
    box-shadow: var(--ui-card-shadow-soft);
    padding: 18px 20px;
    margin-bottom: 12px;
}

.dash-header h2 {
    margin: 0;
    font-size: 24px;
    letter-spacing: .1px;
    color: #1f4058;
}

.dash-header h2 a {
    font-size: 16px;
}

.dash-header p {
    margin: 6px 0 0;
    color: #4f677c;
    font-size: 14px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.kpi-card {
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #d5e1ec;
    box-shadow: var(--ui-card-shadow-soft);
    background: #fff;
}

.kpi-card h3 {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .45px;
    color: #617487;
    font-weight: 600;
}

.kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kpi-icon {
    width: 18px;
    height: 18px;
    color: #4f7695;
    opacity: .9;
}

.kpi-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.kpi-value {
    margin-top: 8px;
    font-size: 22px;
    line-height: 1.1;
    color: #1f3a4d;
    font-weight: 600;
}

.panel h3 {
    font-weight: 600;
    letter-spacing: 0;
}

table {
    font-size: 13.5px !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

td {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
}

td a {
    font-weight: 500;
}

.action-btn,
.action-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 9px;
    border: 1px solid #cfd9e3;
    background: #ffffff;
    color: #2f3a45;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    cursor: pointer;
}

.action-btn:hover,
.action-edit-btn:hover {
    border-color: #b9c8d7;
    background: #f7fafd;
}

.action-btn .icon,
.action-edit-btn .icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
}

.action-btn .icon svg,
.action-edit-btn .icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

button.action-btn {
    background: #ffffff !important;
    border-color: #cfd9e3 !important;
    color: #2f3a45 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

.action-btn-success {
    border-color: #bfdcc8 !important;
    color: #255e3f !important;
    background: #f4fbf7 !important;
}

.action-btn-danger {
    border-color: #e3c7c7 !important;
    color: #8b2f2f !important;
    background: #fff6f6 !important;
}

.action-btn-warning {
    border-color: #e7d7bb !important;
    color: #785321 !important;
    background: #fffaf2 !important;
}

.action-btn-info {
    border-color: #c5d8ea !important;
    color: #214d73 !important;
    background: #f3f8fd !important;
}

thead th:first-child {
    border-top-left-radius: 10px;
}

thead th:last-child {
    border-top-right-radius: 10px;
}

th.action-col,
td.action-col {
    width: 170px;
    min-width: 170px;
    white-space: nowrap;
    vertical-align: middle;
}

.status,
.chip {
    border-radius: 999px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
}

.grid-4 {
    gap: 14px !important;
}

.kpi-card--teal { background: linear-gradient(180deg, #ffffff 0%, #f2fbfc 100%); }
.kpi-card--blue { background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%); }
.kpi-card--orange { background: linear-gradient(180deg, #ffffff 0%, #fff6ef 100%); }
.kpi-card--green { background: linear-gradient(180deg, #ffffff 0%, #f2faf3 100%); }

.dash-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.action-card {
    border: 1px solid #d6e3ee;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.action-card--quick {
    background: #f6fbff;
    border-color: #d8e8f4;
}

.action-card--ops {
    background: #f7fcf9;
    border-color: #d9ebdf;
}

.action-card--exports {
    background: #fffaf4;
    border-color: #f1dfcb;
}

.action-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #28445a;
}

.action-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    justify-content: flex-start;
}

.action-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #cde0ef;
    background: #f8fcff;
    color: #214863;
    font-weight: 500;
    transition: all .18s ease;
}

.action-link:hover {
    background: #eefdff;
    border-color: #9fc6df;
}

.action-tile {
    width: 100%;
    min-height: 98px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: #3f84b0;
    box-shadow: var(--ui-card-shadow-soft);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
}

.action-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-card-shadow);
    filter: brightness(.96);
}

.tile-icon {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.tile-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tile-text {
    display: block;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 600;
    color: #ffffff;
    padding: 0 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
}

/* Solid color tiles by dashboard section */
.action-card--quick .action-tile {
    background: #20a7be;
    border-color: #1b95aa;
}

.action-card--ops .action-tile {
    background: #2e8f79;
    border-color: #287b68;
}

.action-card--exports .action-tile {
    background: #f1b557;
    border-color: #d8a24d;
}

.storage-panel {
    display: flex;
    align-items: center;
    gap: 14px;
}

.storage-ring {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    flex: 0 0 84px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

/* Workshops page cleanup */
.workshop-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.workshop-actions input,
.workshop-token-actions input {
    min-height: 34px;
    padding: 6px 8px !important;
    font-size: 12.5px !important;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.workshop-token-row td {
    background: #f8fbff;
    border-bottom: 1px solid #dbe7f2;
}

.workshop-token-wrap {
    border: 1px solid #d3e2ef;
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
}

.workshop-token-title {
    font-size: 12px;
    font-weight: 600;
    color: #557189;
    text-transform: uppercase;
    letter-spacing: .35px;
    margin-bottom: 6px;
}

.workshop-token-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.workshop-token-table th,
.workshop-token-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #e7eef5;
}

.workshop-token-table tr:last-child td {
    border-bottom: 0;
}

.workshop-token-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.workshop-token-actions button {
    font-size: 12px;
    padding: 6px 9px;
}

.dash-panel--teal {
    background: linear-gradient(180deg, #ffffff 0%, #f2fbfd 100%);
    border-color: #cfe4ea;
}

.dash-panel--blue {
    background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%);
    border-color: #cddff5;
}

.dash-panel--violet {
    background: linear-gradient(180deg, #ffffff 0%, #f6f4ff 100%);
    border-color: #ded8f2;
}

.dash-panel--mint {
    background: linear-gradient(180deg, #ffffff 0%, #f2fff7 100%);
    border-color: #d1eadb;
}

@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-actions {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 980px) {
    .main {
        padding: 0 10px 24px !important;
    }

    .topbar {
        flex-wrap: wrap;
        width: calc(100% + 20px);
        margin: 0 -10px 18px;
        border-radius: 0;
        border-left: 0 !important;
        border-right: 0 !important;
    }

    .topbar .right {
        display: none;
    }

    .topbar-left {
        width: 100%;
        order: 1;
        padding: 0 16px;
    }

    .topbar-company-name-full {
        display: none;
    }

    .topbar-company-name-mobile {
        display: inline;
    }

    .topbar-company-block {
        width: 100%;
    }

    .topbar-user-row {
        display: flex;
        width: 100%;
    }

    .topbar-mobile-bell {
        margin-left: auto !important;
    }

    .sidebar-mobile-tools {
        display: block !important;
    }

    .topbar-assets-pill,
    .topbar-unread-pill {
        display: none !important;
    }

    .topbar-mobile-bell {
        display: inline-flex !important;
    }

    .form-shell .form-head,
    .form-shell .form-content {
        padding: 18px;
    }

    .filters {
        align-items: stretch;
    }

    .filters input,
    .filters select,
    .filters button,
    .filters a {
        width: 100%;
    }

    .filters .btn-add {
        margin-left: 0;
    }

    .panel {
        overflow-x: auto;
    }

    .panel table {
        min-width: 720px;
    }

    .storage-panel {
        align-items: flex-start;
    }

    .action-list {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
    }

    .action-link {
        width: 100%;
    }

    .action-tile {
        width: 100%;
        max-width: none;
    }

    .dashboard-notifications-tile {
        display: none;
    }

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

    .workshop-token-table {
        min-width: 560px;
    }
}

@media (max-width: 640px) {
    .panel table {
        min-width: 0;
    }

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

    .storage-panel {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .storage-ring {
        width: 78px;
        height: 78px;
        min-width: 78px;
        min-height: 78px;
        flex-basis: 78px;
    }

    .storage-panel .muted {
        width: 100%;
        text-align: center;
    }
}
