:root {
    --app-sidebar-width: 264px;
    --app-sidebar-collapsed: 82px;
    --app-topbar-height: 72px;
    --app-primary: #0b6f78;
    --app-primary-dark: #07555c;
    --app-primary-soft: #e9f7f8;
    --app-secondary: #123b5d;
    --app-accent: #22a6b3;
    --app-bg: #f4f7f9;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafb;
    --app-border: #e3e8ed;
    --app-border-strong: #d4dbe3;
    --app-text: #182230;
    --app-muted: #667085;
    --app-success: #16803c;
    --app-success-soft: #dcfae6;
    --app-danger: #d92d20;
    --app-danger-soft: #fee4e2;
    --app-warning: #b54708;
    --app-warning-soft: #fef0c7;
    --app-info: #175cd3;
    --app-info-soft: #eaf2ff;
    --app-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --app-shadow: 0 12px 32px rgba(16, 24, 40, .10);
    --app-radius-sm: 10px;
    --app-radius: 14px;
    --app-radius-lg: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body.app-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--app-bg);
    color: var(--app-text);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

body.app-menu-open {
    overflow: hidden;
}

a {
    color: var(--app-primary);
}

a:hover {
    color: var(--app-primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================
   SIDEBAR
   ========================= */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: var(--app-sidebar-width);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--app-border);
    box-shadow: 8px 0 24px rgba(16, 24, 40, .025);
    transition: width .22s ease, transform .22s ease;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--app-topbar-height);
    padding: 12px 14px 12px 18px;
    border-bottom: 1px solid var(--app-border);
}

.app-brand-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
    color: var(--app-text);
    text-decoration: none;
}

.app-brand-link:hover {
    color: var(--app-text);
}

.app-brand-mark {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--app-primary), var(--app-accent));
    color: #fff;
    box-shadow: 0 8px 18px rgba(11, 111, 120, .22);
    font-size: 20px;
    font-weight: 800;
}

.app-brand-logo {
    display: block;
    width: min(150px, 100%);
    max-height: 42px;
    object-fit: contain;
}

.app-brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.app-brand-copy strong,
.app-brand-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-brand-copy strong {
    font-size: 15px;
    font-weight: 750;
}

.app-brand-copy small {
    margin-top: 1px;
    color: var(--app-muted);
    font-size: 11px;
}

.app-sidebar-collapse {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #fff;
    color: #475467;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .2s ease;
}

.app-sidebar-collapse:hover {
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

.app-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px 22px;
    scrollbar-width: thin;
}

.app-nav-section {
    margin-bottom: 20px;
}

.app-nav-title {
    min-height: 22px;
    padding: 0 11px 7px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin: 3px 0;
    padding: 9px 12px;
    overflow: hidden;
    border-radius: 11px;
    color: #344054;
    text-decoration: none;
    font-size: 14px;
    font-weight: 550;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.app-nav-link i {
    flex: 0 0 auto;
    width: 22px;
    color: #667085;
    text-align: center;
    font-size: 17px;
}

.app-nav-link:hover {
    background: #f2f6f8;
    color: var(--app-text);
    transform: translateX(2px);
}

.app-nav-link:hover i {
    color: var(--app-primary);
}

.app-nav-link.active {
    background: var(--app-primary-soft);
    color: var(--app-primary-dark);
    font-weight: 750;
}

.app-nav-link.active::before {
    position: absolute;
    inset: 8px auto 8px 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--app-primary);
    content: "";
}

.app-nav-link.active i {
    color: var(--app-primary);
}

.app-sidebar-user {
    padding: 13px 14px 15px;
    border-top: 1px solid var(--app-border);
    background: rgba(255, 255, 255, .97);
}

.app-sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border-radius: 12px;
    color: var(--app-text);
    text-decoration: none;
    transition: background .15s ease;
}

.app-sidebar-profile:hover,
.app-sidebar-profile.active {
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.app-sidebar-profile > i {
    margin-left: auto;
    color: #98a2b3;
    font-size: 13px;
}

.app-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #b8e4e8;
    border-radius: 50%;
    background: var(--app-primary-soft);
    color: var(--app-primary-dark);
    font-size: 13px;
    font-weight: 800;
}

.app-avatar.large {
    width: 44px;
    height: 44px;
    font-size: 15px;
}

.app-sidebar-profile-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.app-sidebar-profile-copy strong,
.app-sidebar-profile-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-profile-copy strong {
    font-size: 13px;
}

.app-sidebar-profile-copy small {
    color: var(--app-muted);
    font-size: 11px;
}

/* Collapsed desktop sidebar */
body.app-sidebar-collapsed .app-sidebar {
    width: var(--app-sidebar-collapsed);
}

body.app-sidebar-collapsed .app-main {
    margin-left: var(--app-sidebar-collapsed);
}

body.app-sidebar-collapsed .app-brand-copy,
body.app-sidebar-collapsed .app-nav-link span,
body.app-sidebar-collapsed .app-nav-title,
body.app-sidebar-collapsed .app-sidebar-profile-copy,
body.app-sidebar-collapsed .app-sidebar-profile > i {
    display: none;
}

body.app-sidebar-collapsed .app-sidebar-brand {
    justify-content: center;
    padding-inline: 10px;
}

body.app-sidebar-collapsed .app-brand-link {
    flex: 0 0 auto;
}

body.app-sidebar-collapsed .app-brand-logo {
    width: 44px;
    height: 44px;
    object-position: left center;
}

body.app-sidebar-collapsed .app-sidebar-collapse {
    position: absolute;
    top: 56px;
    right: -15px;
    z-index: 2;
    width: 30px;
    height: 30px;
    background: #fff;
    box-shadow: var(--app-shadow-sm);
    transform: rotate(180deg);
}

body.app-sidebar-collapsed .app-sidebar-scroll {
    padding-inline: 10px;
}

body.app-sidebar-collapsed .app-nav-section {
    margin-bottom: 8px;
}

body.app-sidebar-collapsed .app-nav-link {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
}

body.app-sidebar-collapsed .app-nav-link i {
    width: auto;
    font-size: 19px;
}

body.app-sidebar-collapsed .app-sidebar-profile {
    justify-content: center;
    padding-inline: 0;
}

/* =========================
   MAIN / TOPBAR
   ========================= */
.app-main {
    min-height: 100vh;
    margin-left: var(--app-sidebar-width);
    transition: margin-left .22s ease;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: var(--app-topbar-height);
    padding: 10px 24px;
    border-bottom: 1px solid rgba(227, 232, 237, .95);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.app-topbar-left,
.app-topbar-actions {
    display: flex;
    align-items: center;
}

.app-topbar-left {
    min-width: 0;
    gap: 12px;
}

.app-topbar-actions {
    gap: 10px;
}

.app-menu-button {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    color: #344054;
    font-size: 21px;
    cursor: pointer;
}

.app-topbar-heading {
    min-width: 0;
}

.app-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 11px;
    white-space: nowrap;
}

.app-breadcrumb i {
    font-size: 8px;
}

.app-breadcrumb span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-page-title {
    margin: 0;
    overflow: hidden;
    color: var(--app-text);
    font-size: 19px;
    font-weight: 760;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-quick-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid var(--app-primary);
    border-radius: 10px;
    background: var(--app-primary);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 5px 14px rgba(11, 111, 120, .16);
}

.app-quick-button:hover {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
    color: #fff;
}

.app-user-menu {
    position: relative;
}

.app-user-menu-button {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    max-width: 250px;
    padding: 3px 8px 3px 4px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--app-text);
    cursor: pointer;
}

.app-user-menu-button:hover,
.app-user-menu.open .app-user-menu-button {
    border-color: var(--app-border);
    background: #fff;
}

.app-user-menu-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    text-align: left;
}

.app-user-menu-text strong,
.app-user-menu-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-menu-text strong {
    font-size: 12px;
}

.app-user-menu-text small {
    color: var(--app-muted);
    font-size: 10px;
}

.app-user-menu-caret {
    color: #98a2b3;
    font-size: 11px;
    transition: transform .15s ease;
}

.app-user-menu.open .app-user-menu-caret {
    transform: rotate(180deg);
}

.app-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    display: none;
    width: 240px;
    padding: 7px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--app-shadow);
}

.app-user-menu.open .app-user-dropdown {
    display: block;
    animation: appDropdownIn .14s ease;
}

@keyframes appDropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-user-dropdown-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    margin-bottom: 5px;
    border-radius: 10px;
    background: var(--app-surface-muted);
}

.app-user-dropdown-head div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.app-user-dropdown-head strong,
.app-user-dropdown-head small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-dropdown-head strong {
    font-size: 13px;
}

.app-user-dropdown-head small {
    color: var(--app-muted);
    font-size: 11px;
}

.app-user-dropdown > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: 9px;
    color: #344054;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.app-user-dropdown > a:hover {
    background: var(--app-surface-muted);
    color: var(--app-primary-dark);
}

.app-user-dropdown > a.danger {
    color: var(--app-danger);
}

.app-user-dropdown-divider {
    height: 1px;
    margin: 5px 2px;
    background: var(--app-border);
}

.app-content {
    min-height: calc(100vh - var(--app-topbar-height) - 52px);
    padding: 24px;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 24px;
    color: #98a2b3;
    font-size: 11px;
}

.app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(16, 24, 40, .48);
    backdrop-filter: blur(2px);
}

/* =========================
   PAGE / CARDS / TOOLBAR
   ========================= */
.app-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.app-page-header h1,
.app-page-header h2 {
    margin: 0;
    color: var(--app-text);
    font-size: 24px;
    font-weight: 780;
    line-height: 1.25;
}

.app-page-header p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--app-muted);
    font-size: 13px;
}

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

.app-card {
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
}

.app-card + .app-card {
    margin-top: 18px;
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 62px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--app-border);
    background: #fff;
}

.app-card-heading {
    min-width: 0;
}

.app-card-title {
    margin: 0;
    color: var(--app-text);
    font-size: 16px;
    font-weight: 750;
}

.app-card-subtitle {
    margin: 3px 0 0;
    color: var(--app-muted);
    font-size: 12px;
}

.app-card-body {
    padding: 20px;
}

.app-card-body.flush {
    padding: 0;
}

.app-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-toolbar-between {
    justify-content: space-between;
}

.app-search {
    flex: 1 1 320px;
    min-width: 220px;
}

.app-search-box {
    position: relative;
}

.app-search-box > i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: #98a2b3;
    transform: translateY(-50%);
}

.app-search-box .form-control {
    padding-left: 38px;
}

.app-section-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.app-col-4 { grid-column: span 4; }
.app-col-5 { grid-column: span 5; }
.app-col-6 { grid-column: span 6; }
.app-col-7 { grid-column: span 7; }
.app-col-8 { grid-column: span 8; }
.app-col-12 { grid-column: span 12; }

/* =========================
   FORMS / BUTTONS
   ========================= */
.app-content .form-control,
.app-content .form-select,
.app-content input[type="text"],
.app-content input[type="email"],
.app-content input[type="password"],
.app-content input[type="date"],
.app-content input[type="number"],
.app-content select,
.app-content textarea {
    min-height: 42px;
    border-color: var(--app-border-strong);
    border-radius: 10px;
    box-shadow: none;
}

.app-content textarea {
    min-height: 86px;
}

.app-content .form-control:focus,
.app-content .form-select:focus,
.app-content input:focus,
.app-content select:focus,
.app-content textarea:focus {
    border-color: #69bbc2;
    box-shadow: 0 0 0 3px rgba(11, 111, 120, .11);
}

.app-content .form-label,
.app-form-grid label {
    margin-bottom: 6px;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.app-content .btn {
    min-height: 40px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.app-content .btn-primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
}

.app-content .btn-primary:hover,
.app-content .btn-primary:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
}

.app-content .btn-outline-primary {
    border-color: #79bfc5;
    color: var(--app-primary-dark);
}

.app-content .btn-outline-primary:hover {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

.app-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 17px;
}

.app-form-grid .full {
    grid-column: 1 / -1;
}

.app-help {
    margin-top: 5px;
    color: var(--app-muted);
    font-size: 11px;
}

.app-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--app-border);
}

.app-password-field {
    position: relative;
}

.app-password-field input {
    padding-right: 44px;
}

.app-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #667085;
    transform: translateY(-50%);
}

.app-password-toggle:hover {
    background: var(--app-surface-muted);
    color: var(--app-primary);
}

/* =========================
   TABLES
   ========================= */
.app-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.app-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.app-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--app-border);
    background: #f8fafb;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f3;
    color: #344054;
    vertical-align: middle;
}

.app-table tbody tr:last-child td {
    border-bottom: 0;
}

.app-table tbody tr:hover td {
    background: #fbfdfd;
}

.app-table .text-truncate-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.app-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 9px;
    background: #fff;
    color: #344054;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.app-icon-button:hover {
    border-color: #b6c1cc;
    background: var(--app-surface-muted);
    color: var(--app-text);
}

.app-icon-button.primary { border-color: #9bcdd2; color: var(--app-primary); }
.app-icon-button.success { border-color: #75e0a7; color: var(--app-success); }
.app-icon-button.warning { border-color: #fec84b; color: var(--app-warning); }
.app-icon-button.danger { border-color: #fda29b; color: var(--app-danger); }
.app-icon-button:disabled { opacity: .48; cursor: not-allowed; }

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.app-badge.success { background: var(--app-success-soft); color: #067647; }
.app-badge.danger { background: var(--app-danger-soft); color: #b42318; }
.app-badge.warning { background: var(--app-warning-soft); color: #b54708; }
.app-badge.info { background: var(--app-info-soft); color: var(--app-info); }
.app-badge.neutral { background: #f2f4f7; color: #475467; }

/* =========================
   SUMMARY / DASHBOARD
   ========================= */
.app-welcome {
    position: relative;
    overflow: hidden;
    padding: 24px;
    margin-bottom: 18px;
    border-radius: var(--app-radius-lg);
    background: linear-gradient(125deg, #0b6f78 0%, #123b5d 100%);
    color: #fff;
    box-shadow: 0 16px 36px rgba(18, 59, 93, .18);
}

.app-welcome::after {
    position: absolute;
    top: -70px;
    right: -50px;
    width: 220px;
    height: 220px;
    border: 38px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    content: "";
}

.app-welcome-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.app-welcome-eyebrow {
    margin-bottom: 5px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-welcome h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 780;
}

.app-welcome p {
    margin: 7px 0 0;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
}

.app-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.app-summary-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--app-shadow-sm);
}

.app-summary-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 20px;
}

.app-summary-icon.blue { background: #eaf2ff; color: #175cd3; }
.app-summary-icon.green { background: #dcfae6; color: #067647; }
.app-summary-icon.orange { background: #fef0c7; color: #b54708; }

.app-summary-copy {
    min-width: 0;
}

.app-summary-label {
    overflow: hidden;
    color: var(--app-muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-summary-value {
    margin-top: 3px;
    overflow: hidden;
    color: var(--app-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-summary-note {
    margin-top: 2px;
    color: #98a2b3;
    font-size: 10px;
}

.app-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.app-shortcut {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 64px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    color: var(--app-text);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.app-shortcut:hover {
    border-color: #a9d5d9;
    background: #fbfefe;
    color: var(--app-text);
    transform: translateY(-1px);
}

.app-shortcut-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 17px;
}

.app-shortcut strong,
.app-shortcut small {
    display: block;
}

.app-shortcut strong {
    font-size: 12px;
}

.app-shortcut small {
    margin-top: 2px;
    color: var(--app-muted);
    font-size: 10px;
}

/* =========================
   ALERT / EMPTY / PAGINATION
   ========================= */
.app-content .alert {
    border: 0;
    border-radius: 12px;
    font-size: 13px;
}

.app-empty {
    padding: 40px 20px;
    color: var(--app-muted);
    text-align: center;
}

.app-empty i {
    display: block;
    margin-bottom: 10px;
    color: #98a2b3;
    font-size: 34px;
}

.app-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--app-border);
}

.app-pagination-links {
    display: flex;
    gap: 5px;
}

.app-pagination-links a,
.app-pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: #344054;
    text-decoration: none;
    font-size: 12px;
}

.app-pagination-links .active {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

/* =========================
   MODAL / TOAST / FAB
   ========================= */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.app-modal.show {
    display: flex;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, .50);
    backdrop-filter: blur(2px);
}

.app-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--app-shadow);
}

.app-modal-dialog.wide {
    max-width: 900px;
}

.app-modal-header,
.app-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
}

.app-modal-header { border-bottom: 1px solid var(--app-border); }
.app-modal-footer { justify-content: flex-end; border-top: 1px solid var(--app-border); }
.app-modal-title { margin: 0; font-size: 17px; font-weight: 750; }
.app-modal-body { padding: 20px; }

.app-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #f2f4f7;
    color: #475467;
    font-size: 20px;
}

.app-toast-container {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1400;
    display: grid;
    width: min(380px, calc(100vw - 28px));
    gap: 8px;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #344054;
    border-radius: 12px;
    background: #182230;
    color: #fff;
    box-shadow: var(--app-shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .18s ease, transform .18s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.app-toast.success { border-color: #079455; background: #067647; }
.app-toast.error { border-color: #d92d20; background: #b42318; }
.app-toast.warning { border-color: #dc6803; background: #b54708; }

.app-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: var(--app-primary);
    color: #fff;
    box-shadow: 0 12px 26px rgba(11, 111, 120, .30);
    cursor: pointer;
    font-size: 22px;
    transition: background .15s ease, transform .15s ease;
}

.app-fab:hover {
    background: var(--app-primary-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* =========================
   PERMISSION / ADMIN
   ========================= */
.permission-module {
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 12px;
}

.permission-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--app-border);
    background: #f8fafb;
    font-weight: 750;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.permission-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef0f3;
}

.permission-item:nth-child(odd) {
    border-right: 1px solid #eef0f3;
}

.permission-item-title { font-size: 12px; font-weight: 700; }
.permission-item-desc { margin-top: 2px; color: var(--app-muted); font-size: 11px; }

/* =========================
   ACCOUNT / SETTINGS
   ========================= */
.app-profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: linear-gradient(135deg, #f6fcfc, #f7f9fc);
}

.app-profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: linear-gradient(145deg, var(--app-primary), var(--app-secondary));
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(18, 59, 93, .18);
}

.app-profile-copy h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 780;
}

.app-profile-copy p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 12px;
}

.app-detail-list {
    display: grid;
    gap: 0;
}

.app-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid #edf0f3;
}

.app-detail-row:last-child {
    border-bottom: 0;
}

.app-detail-label { color: var(--app-muted); font-size: 12px; }
.app-detail-value { color: var(--app-text); font-size: 12px; font-weight: 700; text-align: right; }

.app-settings-group {
    padding: 18px 0;
    border-bottom: 1px solid var(--app-border);
}

.app-settings-group:first-child { padding-top: 0; }
.app-settings-group:last-child { padding-bottom: 0; border-bottom: 0; }
.app-settings-group h3 { margin: 0 0 4px; font-size: 15px; font-weight: 750; }
.app-settings-group > p { margin: 0 0 16px; color: var(--app-muted); font-size: 12px; }

/* =========================
   LOGIN
   ========================= */
body.app-login-body {
    min-height: 100vh;
    margin: 0;
    background: #eef4f6;
    color: var(--app-text);
    font-family: "Segoe UI", Inter, Arial, sans-serif;
}

.app-login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr);
}

.app-login-brand-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    background: linear-gradient(145deg, #0b6f78 0%, #123b5d 100%);
    color: #fff;
}

.app-login-brand-panel::before,
.app-login-brand-panel::after {
    position: absolute;
    border: 40px solid rgba(255, 255, 255, .055);
    border-radius: 50%;
    content: "";
}

.app-login-brand-panel::before {
    top: -120px;
    right: -90px;
    width: 320px;
    height: 320px;
}

.app-login-brand-panel::after {
    bottom: -150px;
    left: -120px;
    width: 380px;
    height: 380px;
}

.app-login-brand,
.app-login-message,
.app-login-features,
.app-login-copyright {
    position: relative;
    z-index: 1;
}

.app-login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-login-brand .app-brand-mark {
    background: rgba(255, 255, 255, .16);
    box-shadow: none;
}

.app-login-brand strong,
.app-login-brand small {
    display: block;
}

.app-login-brand strong { font-size: 16px; }
.app-login-brand small { color: rgba(255, 255, 255, .7); font-size: 11px; }

.app-login-message {
    max-width: 540px;
    margin: auto 0;
}

.app-login-message h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.08;
}

.app-login-message p {
    max-width: 500px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .76);
    font-size: 14px;
}

.app-login-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

.app-login-feature {
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(6px);
}

.app-login-feature i { display: block; margin-bottom: 7px; font-size: 18px; }
.app-login-feature strong { display: block; font-size: 11px; }
.app-login-feature small { color: rgba(255, 255, 255, .65); font-size: 9px; }

.app-login-copyright {
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
}

.app-login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: #f7fafb;
}

.app-login-card {
    width: 100%;
    max-width: 430px;
    padding: 30px;
    border: 1px solid var(--app-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(16, 24, 40, .10);
}

.app-login-card h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.app-login-card > p {
    margin: 7px 0 24px;
    color: var(--app-muted);
    font-size: 12px;
}

.app-login-card .form-control {
    min-height: 46px;
    border-color: var(--app-border-strong);
    border-radius: 11px;
}

.app-login-card .form-control:focus {
    border-color: #69bbc2;
    box-shadow: 0 0 0 3px rgba(11, 111, 120, .11);
}

.app-login-submit {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 11px;
    background: var(--app-primary);
    color: #fff;
    font-weight: 750;
}

.app-login-submit:hover { background: var(--app-primary-dark); }
.app-login-note { margin-top: 18px; color: #98a2b3; font-size: 10px; text-align: center; }

/* =========================
   LEGACY PAGE COMPATIBILITY
   ========================= */
.app-content > h3:first-child {
    margin: 0 0 6px;
    font-size: 23px;
    font-weight: 780;
}

.app-content > h3:first-child + p {
    margin-top: 0;
    color: var(--app-muted);
}

.app-content > .card {
    overflow: hidden;
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.app-content > .card > h3,
.app-content > .card > h4 {
    margin: 0;
    padding: 18px 20px 10px;
    font-size: 18px;
    font-weight: 750;
}

.app-content > .card > form,
.app-content > .card > div,
.app-content > .card > table {
    margin-left: 20px;
    margin-right: 20px;
}

.app-content .table {
    font-size: 13px;
}

.app-content .table th {
    background: #f8fafb;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-content .table td {
    vertical-align: middle;
}

.btn-outline-orange {
    border-color: #ff6600;
    color: #ff6600;
}

.btn-outline-orange:hover {
    border-color: #ff6600;
    background: #ff6600;
    color: #fff;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1199.98px) {
    .app-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-col-4,
    .app-col-5,
    .app-col-7,
    .app-col-8 {
        grid-column: span 6;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar,
    body.app-sidebar-collapsed .app-sidebar {
        width: min(286px, calc(100vw - 48px));
        transform: translateX(-100%);
        box-shadow: var(--app-shadow);
    }

    body.app-menu-open .app-sidebar {
        transform: translateX(0);
    }

    body.app-menu-open .app-sidebar-backdrop {
        display: block;
    }

    .app-sidebar-collapse {
        display: none;
    }

    body.app-sidebar-collapsed .app-brand-copy,
    body.app-sidebar-collapsed .app-nav-link span,
    body.app-sidebar-collapsed .app-nav-title,
    body.app-sidebar-collapsed .app-sidebar-profile-copy,
    body.app-sidebar-collapsed .app-sidebar-profile > i {
        display: initial;
    }

    body.app-sidebar-collapsed .app-nav-link {
        justify-content: flex-start;
        gap: 12px;
        padding-inline: 12px;
    }

    body.app-sidebar-collapsed .app-nav-link i {
        width: 22px;
        font-size: 17px;
    }

    body.app-sidebar-collapsed .app-sidebar-profile {
        justify-content: flex-start;
        padding: 9px;
    }

    .app-main,
    body.app-sidebar-collapsed .app-main {
        margin-left: 0;
    }

    .app-menu-button {
        display: inline-flex;
    }

    .app-login-shell {
        grid-template-columns: 1fr;
    }

    .app-login-brand-panel {
        display: none;
    }

    .app-login-form-panel {
        min-height: 100vh;
    }
}

@media (max-width: 767.98px) {
    :root {
        --app-topbar-height: 64px;
    }

    .app-topbar {
        padding: 8px 13px;
    }

    .app-breadcrumb,
    .app-user-menu-text,
    .app-user-menu-caret,
    .app-quick-button span {
        display: none;
    }

    .app-page-title {
        font-size: 17px;
    }

    .app-quick-button {
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
    }

    .app-user-menu-button {
        padding: 2px;
    }

    .app-content {
        padding: 14px;
    }

    .app-footer {
        padding: 10px 14px;
    }

    .app-footer-dot,
    .app-footer span:last-child {
        display: none;
    }

    .app-page-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 15px;
    }

    .app-page-header h1,
    .app-page-header h2 {
        font-size: 21px;
    }

    .app-page-actions > * {
        flex: 1 1 auto;
    }

    .app-card-header,
    .app-card-body {
        padding: 15px;
    }

    .app-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .app-toolbar > *,
    .app-search {
        width: 100%;
        min-width: 0;
    }

    .app-section-grid {
        gap: 14px;
    }

    .app-col-4,
    .app-col-5,
    .app-col-6,
    .app-col-7,
    .app-col-8,
    .app-col-12 {
        grid-column: span 12;
    }

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

    .app-summary-card {
        padding: 14px;
    }

    .app-shortcuts {
        grid-template-columns: 1fr;
    }

    .app-form-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .permission-item:nth-child(odd) {
        border-right: 0;
    }

    .app-form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .app-form-actions .btn {
        width: 100%;
    }

    .app-welcome {
        padding: 20px;
    }

    .app-welcome h2 {
        font-size: 21px;
    }

    .app-profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-detail-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .app-detail-value {
        text-align: left;
    }

    .app-modal {
        align-items: flex-end;
        padding: 0;
    }

    .app-modal-dialog,
    .app-modal-dialog.wide {
        max-width: none;
        max-height: 94vh;
        border-radius: 18px 18px 0 0;
    }

    .app-toast-container {
        right: 14px;
        bottom: 14px;
    }

    .app-fab {
        right: 18px;
        bottom: 18px;
        width: 52px;
        height: 52px;
    }

    .app-login-form-panel {
        padding: 18px;
    }

    .app-login-card {
        padding: 23px;
        border-radius: 16px;
    }

    .app-content > .card > h3,
    .app-content > .card > h4 {
        padding-inline: 15px;
    }

    .app-content > .card > form,
    .app-content > .card > div,
    .app-content > .card > table {
        margin-left: 15px;
        margin-right: 15px;
    }
}

@media (max-width: 420px) {
    .app-user-dropdown {
        position: fixed;
        top: 70px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .app-summary-value {
        font-size: 20px;
    }
}
