/* =========================================================
   CIT Customer Document Manager - Premium Dashboard UI
   UI polishing only. No functionality changes.
========================================================= */

:root {
    --cit-primary: #ff2d20;
    --cit-primary-light: #e62216;
    --cit-primary-soft: #eef4ff;
    --cit-bg: #f4f7fb;
    --cit-surface: #ffffff;
    --cit-text: #0f172a;
    --cit-muted: #64748b;
    --cit-border: #e5eaf1;
    --cit-green: #2e7d32;
    --cit-red: #c62828;
    --cit-orange: #ef6c00;
    --cit-purple: #6a1b9a;
    --cit-radius-lg: 16px;
    --cit-radius-md: 12px;
    --cit-shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
    --cit-shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

.cit-dashboard-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--cit-bg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--cit-text);
}

/* =========================
   Sidebar
========================= */

.cit-dashboard-sidebar {
    width: 244px;
    flex-shrink: 0;
    padding: 24px 18px;
    background: #ff2d20;
    color: #ffffff;
    box-shadow: 8px 0 28px rgba(13, 71, 161, 0.12);
}

.cit-dashboard-logo {
    margin-bottom: 26px;
    padding: 4px 8px 22px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.cit-dashboard-logo img {
    width: 146px;
    max-width: 100%;
    margin-bottom: 13px;
}

.cit-dashboard-logo h2,
.cit-dashboard-sidebar h2 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.cit-dashboard-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 45px;
    margin-bottom: 6px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.cit-dashboard-menu:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.cit-dashboard-menu.active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.13);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #ffffff;
}

.cit-dashboard-menu .dashicons {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin: 0;
    font-size: 19px;
    line-height: 20px;
    opacity: 0.95;
}
.cit-dashboard-greeting{
    margin:0;
    font-size:34px;
    font-weight:700;
    line-height:0.5;
}

.cit-dashboard-user-name{
    margin-top:6px;
    font-size:34px;
    font-weight:700;   /* Make it bold */
    color:#1a1a1a;     /* Dark text like the greeting */
}
/* =========================================================
   CIT LOCATION GATEWAY
========================================================= */

.cit-location-gateway {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px 20px;
    box-sizing: border-box;
    background: #f4f6f9;
}

.cit-location-gateway-box {
    width: 100%;
    max-width: 520px;
    padding: 42px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.10);
}

.cit-location-gateway-header {
    margin-bottom: 30px;
    text-align: center;
}

.cit-location-logo {
    display: block;
    width: auto;
    max-width: 210px;
    max-height: 85px;
    margin: 0 auto 24px;
    object-fit: contain;
}

.cit-location-gateway-header h2 {
    margin: 0 0 10px;
    color: #1f2937;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.cit-location-gateway-header p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
}

.cit-location-form label {
    display: block;
    margin-bottom: 9px;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.cit-location-form select {
    display: block;
    width: 100%;
    height: 52px;
    margin-bottom: 18px;
    padding: 0 16px;
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    font-size: 15px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.cit-location-form select:focus {
    border-color: #ff2d20;
    box-shadow: 0 0 0 3px rgba(255, 45, 32, 0.12);
}

.cit-location-continue-button {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 20px;
    box-sizing: border-box;
    background: #ff2d20;
    color: #ffffff;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.cit-location-continue-button:hover {
    background: #df1f15;
    color: #ffffff;
    transform: translateY(-1px);
}

.cit-location-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 18px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.cit-location-divider::before,
.cit-location-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.cit-add-location-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    box-sizing: border-box;
    background: #ffffff;
    color: #ff2d20;
    border: 1px solid #ff2d20;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.cit-add-location-button:hover {
    background: #ff2d20;
    color: #ffffff;
    text-decoration: none;
}

.cit-add-location-button .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.cit-location-empty-message {
    padding: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    border-radius: 9px;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 600px) {

    .cit-location-gateway {
        padding: 20px 14px;
    }

    .cit-location-gateway-box {
        padding: 30px 22px;
        border-radius: 12px;
    }

    .cit-location-logo {
        max-width: 175px;
    }

    .cit-location-gateway-header h2 {
        font-size: 25px;
    }
}
/* =========================
   Main content
========================= */

.cit-dashboard-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - 244px);
    max-width: none;
    padding: 20px 15px 35px;
}

.cit-dashboard-content h1,
.cit-dashboard-content h2,
.cit-dashboard-content p {
    letter-spacing: -0.15px;
}

/* =========================
   Header
========================= */

.cit-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    margin-bottom: 22px;
    border: 1px solid var(--cit-border);
    border-radius: var(--cit-radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--cit-shadow-sm);
}

.cit-dashboard-welcome h1,
.cit-dashboard-content h1 {
    margin: 0 0 5px;
    color: var(--cit-text);
    font-size: clamp(24px, 2vw, 29px);
    font-weight: 750;
    line-height: 1.2;
}

.cit-dashboard-welcome p {
    margin: 0;
    color: var(--cit-muted);
    font-size: 14px;
    line-height: 1.5;
}

.cit-dashboard-datetime {
    min-width: 225px;
    padding: 11px 15px;
    border: 1px solid #dbe7fb;
    border-radius: 11px;
    background: linear-gradient(135deg, #f4f8ff 0%, #eaf2ff 100%);
    text-align: right;
}

.cit-dashboard-datetime strong,
.cit-dashboard-datetime span {
    display: block;
}

.cit-dashboard-datetime strong {
    margin-bottom: 3px;
    color: #36578a;
    font-size: 12px;
    font-weight: 700;
}

.cit-dashboard-datetime span {
    color: var(--cit-text);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

/* =========================
   Sections
========================= */

.cit-dashboard-section {
    margin-top: 24px;
}

.cit-dashboard-section h2 {
    position: relative;
    margin: 0 0 13px;
    padding-left: 12px;
    color: #1e293b;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.35;
}

.cit-dashboard-section h2::before {
    content: "";
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 4px;
    border-radius: 10px;
    background: var(--cit-primary-light);
}

/* =========================
   KPI grid
========================= */

.cit-dashboard-cards {
    display: grid;
    gap: 16px;
}

.cit-dashboard-cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cit-dashboard-cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cit-dashboard-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 152px;
    padding: 18px 18px 17px;
    overflow: hidden;
    border: 1px solid var(--cit-border);
    border-top: 4px solid var(--cit-primary-light);
    border-left: 0;
    border-radius: 14px;
    background: var(--cit-surface);
    text-align: center;
    box-shadow: var(--cit-shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.cit-dashboard-card::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -42px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(21, 101, 192, 0.035);
    pointer-events: none;
}

.cit-dashboard-card:hover {
    transform: translateY(-3px);
    border-color: #d7deea;
    box-shadow: var(--cit-shadow-md);
}

.cit-dashboard-card-success {
    border-top-color: var(--cit-green);
}

.cit-dashboard-card-danger {
    border-top-color: var(--cit-red);
}

.cit-dashboard-card-warning {
    border-top-color: var(--cit-orange);
}

.cit-dashboard-card-purple {
    border-top-color: var(--cit-purple);
}

.cit-dashboard-card strong {
    order: 2;
    margin: 2px 0 4px;
    color: var(--cit-text);
    font-size: clamp(32px, 3vw, 42px);
    font-weight: 760;
    line-height: 1;
    letter-spacing: -1.2px;
}

.cit-dashboard-card-label {
    order: 3;
    color: var(--cit-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.cit-dashboard-card small {
    order: 4;
    margin-top: 7px !important;
    color: var(--cit-muted) !important;
    font-size: 11px;
    line-height: 1.4;
}

/* Document summary cards without icons */
.cit-dashboard-cards-4 .cit-dashboard-card:not(:first-child) {
    justify-content: center;
    min-height: 152px;
}

.cit-dashboard-cards-4 .cit-dashboard-card:not(:first-child) .cit-dashboard-card-label {
    order: 2;
    margin-bottom: 8px;
}

.cit-dashboard-cards-4 .cit-dashboard-card:not(:first-child) strong {
    order: 3;
    margin: 0;
}

/* =========================
   KPI icons
========================= */

.cit-dashboard-card-icon {
    order: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
    border-radius: 13px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.035);
}

.cit-dashboard-card-icon .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
    line-height: 24px;
}

.cit-icon-blue {
    background: #e8f2ff;
    color: #e62216;
}

.cit-icon-green {
    background: #eaf6ec;
    color: #2e7d32;
}

.cit-icon-red {
    background: #fdecee;
    color: #c62828;
}

.cit-icon-purple {
    background: #f5ebf8;
    color: #6a1b9a;
}

.cit-icon-orange {
    background: #fff1e5;
    color: #ef6c00;
}

/* =========================
   Progress bar
========================= */

.cit-document-progress {
    order: 5;
    width: 100%;
    height: 7px;
    margin-top: 11px;
    overflow: hidden;
    border-radius: 20px;
    background: #e7ecf2;
}

.cit-document-progress-bar {
    height: 100%;
    min-width: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #2e7d32 0%, #66bb6a 100%);
    transition: width 0.5s ease;
}

/* =========================
   Responsive
========================= */

@media (min-width: 1500px) {
    .cit-dashboard-content {
        padding-left: 15px;
        padding-right: 15px;
    }

    .cit-dashboard-cards {
        gap: 18px;
    }
}

@media (max-width: 1180px) {
    .cit-dashboard-cards-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cit-dashboard-sidebar {
        width: 220px;
    }

    .cit-dashboard-content {
        width: calc(100% - 220px);
        padding: 24px 20px 36px;
    }

    .cit-dashboard-cards-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .cit-dashboard-shell {
        display: block;
    }

    .cit-dashboard-sidebar {
        width: auto;
        padding: 20px 16px;
    }

    .cit-dashboard-content {
        width: 100%;
        padding: 22px 16px 34px;
    }

    .cit-dashboard-header {
        display: block;
        padding: 18px;
    }

    .cit-dashboard-datetime {
        min-width: 0;
        margin-top: 15px;
        text-align: left;
    }

    .cit-dashboard-cards-3,
    .cit-dashboard-cards-4 {
        grid-template-columns: 1fr;
    }

    .cit-dashboard-card {
        min-height: 142px;
    }
}
/* ===========================
   Customer List - ERP Style
=========================== */

.cit-company-list-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.cit-company-list-header h2{
    margin:0;
    font-size:28px;
    font-weight:700;
    color:#1e293b;
}

.cit-company-list-total{
    margin:6px 0 0;
    color:#64748b;
    font-size:14px;
}

.cit-company-table{
    width:100%;
    border-collapse:collapse;
    background:#ffffff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 4px 18px rgba(15,23,42,.06);
}

.cit-company-table th{
    background:#ff2d20;
    color:#ffffff;
    padding:15px 18px;
    text-align:left;
    font-size:14px;
    font-weight:600;
}
.cit-company-table th{
    background:#ff2d20;
    color:#fff;
    padding:14px 18px;
    font-size:14px;
    font-weight:600;
    text-align:left;
}
.cit-company-row:hover{
    background:#eef5ff;
    transition:0.2s ease;
    cursor:pointer;
}
.cit-company-row:nth-child(even){
    background:#f8fafc;
}
.cit-view-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:8px 14px;
    background:#ff2d20;
    color:#ffffff;
    text-decoration:none;
    border-radius:6px;
    font-size:13px;
    font-weight:600;
    transition:all .2s ease;
}

.cit-view-button:hover{
    background:#e62216;
    color:#ffffff;
}

.cit-view-button .dashicons{
    font-size:16px;
    width:16px;
    height:16px;
}
.cit-company-search-wrap{
    display:flex;
    align-items:center;
    gap:8px;
    background:#ffffff;
    border:1px solid #dbe3ef;
    border-radius:8px;
    padding:0 12px;
    min-width:280px;
    height:42px;
}

.cit-company-search-wrap .dashicons{
    color:#64748b;
    font-size:18px;
}

.cit-company-search{
    border:none !important;
    outline:none !important;
    box-shadow:none !important;
    width:100%;
    font-size:14px;
    background:transparent;
}

.cit-company-search:focus{
    outline:none;
    box-shadow:none;
}
.cit-sortable-column{
    cursor:pointer;
    user-select:none;
    transition:background .2s ease;
}

.cit-sortable-column:hover{
    background:#e62216;
}

.cit-sortable-column{
    cursor:pointer;
    user-select:none;
    transition:background .2s ease;
    position:relative;
    padding-right:28px !important;
}

.cit-sortable-column:hover{
    background:#e62216;
}

.cit-sort-indicator{
    position:absolute;
    right:10px;
    top:50%;
    transform:translateY(-50%);
    font-size:13px;
    opacity:.75;
}
.cit-dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 160px;
    text-align: center;
}

.cit-dashboard-card strong {
    display: block;
    margin: 0;
    line-height: 1;
}

.cit-dashboard-card-label {
    display: block;
    margin: 0;
    line-height: 1.3;
}

.cit-dashboard-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}
.cit-dashboard-card {
    transition: all 0.25s ease;
    cursor: pointer;
}

.cit-dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}
.cit-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px;
    background: #f4f7fb;
}

.cit-login-box {
    width: 100%;
    max-width: 420px;
    padding: 38px;
    border: 1px solid #e5eaf1;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.10);
}

.cit-login-box h2 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 25px;
    line-height: 1.3;
}

.cit-login-box p {
    margin: 0 0 24px;
    color: #64748b;
    font-size: 14px;
}

.cit-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 12px 24px;
    border-radius: 8px;
    background: #ff2d20;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.cit-login-button:hover {
    background: #e62216;
    color: #ffffff !important;
}
.cit-login-logo{
    display:block;
    width:180px;
    max-width:100%;
    margin:0 auto 22px;
}

.cit-login-box h2{
    margin:0 0 10px;
    font-size:36px;
    font-weight:700;
    line-height:1.2;
    color:#111827;
}

.cit-login-box p{
    margin:0 0 28px;
    color:#64748b;
    font-size:15px;
}
.cit-logout-menu {
    margin-top: auto;
    background: #c62828;
    color: #fff !important;
}

.cit-logout-menu:hover {
    background: #b71c1c !important;
    color: #fff !important;
}

.cit-logout-menu .dashicons {
    margin-right: 8px;
}
.cit-login-error {
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdeaea;
    color: #c62828;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.cit-add-location-button {
    cursor: pointer;
    font-family: inherit;
}
.cit-user-edit-button,
.cit-user-action-delete {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 32px;

    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #fff;

    margin-right: 4px;
    margin-bottom: 0;
}

.cit-user-edit-button{
    background:#ff2d20;
}

.cit-user-edit-button:hover{
    background:#d91f14;
}

.cit-user-action-delete{
    background:#222222;
}

.cit-user-action-delete:hover{
    background:#000000;
}

/* Keep both buttons on one line */
.cit-user-table td:last-child{
    white-space: nowrap;
}
.cit-dashboard-parent-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.cit-dashboard-expand-toggle {
    width: 24px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cit-dashboard-expand-toggle:hover {
    background: transparent;
    color: #ffffff;
}

.cit-dashboard-expand-toggle .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.cit-dashboard-parent-link {
    flex: 1;
    margin-bottom: 0 !important;
}

#cit-customer-menu {
    margin-left: 28px;
}


/* =========================================================
   Expanded Sidebar Submenu Highlight
   Applies to CDM, Human Resources, Finance and future groups
========================================================= */

.cit-sidebar-collapsible {
    margin: 0 0 12px 28px;
    padding: 8px 8px 6px;
    background: #ff5a50;
    border-left: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 0 10px 10px 0;
}

.cit-sidebar-collapsible .cit-dashboard-menu {
    min-height: 42px;
    margin-bottom: 4px;
    padding: 10px 11px;
    background: transparent;
    border-color: transparent;
    color: #ffffff;
}

.cit-sidebar-collapsible .cit-dashboard-menu:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateX(2px);
}

.cit-sidebar-collapsible .cit-dashboard-menu.active {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    box-shadow: inset 3px 0 0 #ffffff;
}

.cit-sidebar-collapsible .cit-dashboard-menu .dashicons {
    color: #ffffff;
}

/* Keep the parent row visually separate from the open submenu */
.cit-dashboard-parent-row:has(+ .cit-sidebar-collapsible[style*="display:block"]) {
    margin-bottom: 4px;
}

@media (max-width: 800px) {
    .cit-sidebar-collapsible {
        margin-left: 22px;
    }
}
