/* ============================================================
   Smart Ledger - Complete Shared CSS
   ============================================================
   This is the single CSS file used throughout Smart Ledger.

   No Bootstrap or external CSS framework is used.
   ============================================================ */


/* ============================================================
   1. GLOBAL RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    color: #1f2937;

    background: #f4f6f8;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}


/* ============================================================
   2. LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: #f4f6f8;
}

.login-box {
    width: 100%;
    max-width: 420px;

    background: #ffffff;

    border: 1px solid #e1e5e9;

    border-radius: 10px;

    padding: 35px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.08);
}

.login-box h1 {
    margin: 0;

    text-align: center;

    font-size: 28px;

    color: #1f2937;
}

.login-subtitle {
    margin: 8px 0 28px;

    text-align: center;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   3. FORM ELEMENTS
   ============================================================ */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    font-size: 14px;

    font-weight: 600;

    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea,

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;

    border: 1px solid #d1d5db;

    border-radius: 6px;

    background: #ffffff;

    color: #1f2937;

    padding: 10px 12px;

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: #6b7280;

    box-shadow:
        0 0 0 3px rgba(107, 114, 128, 0.10);
}

textarea {
    min-height: 100px;

    resize: vertical;
}

input[readonly],
select[disabled],
textarea[readonly] {
    background: #f3f4f6;

    color: #6b7280;

    cursor: not-allowed;
}


/* ============================================================
   4. BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 40px;

    padding: 9px 16px;

    border: 1px solid transparent;

    border-radius: 6px;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: #1f2937;

    border-color: #1f2937;

    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;

    border-color: #d1d5db;

    color: #374151;
}

.btn-success {
    background: #166534;

    border-color: #166534;

    color: #ffffff;
}

.btn-danger {
    background: #b91c1c;

    border-color: #b91c1c;

    color: #ffffff;
}

.btn-warning {
    background: #b45309;

    border-color: #b45309;

    color: #ffffff;
}

.btn-small {
    min-height: 34px;

    padding: 7px 12px;

    font-size: 13px;
}

.login-button {
    width: 100%;

    margin-top: 5px;
}


/* ============================================================
   5. ALERTS
   ============================================================ */

.alert {
    padding: 12px 14px;

    margin-bottom: 18px;

    border-radius: 6px;

    font-size: 14px;
}

.alert-success {
    background: #ecfdf5;

    border: 1px solid #a7f3d0;

    color: #065f46;
}

.alert-danger {
    background: #fef2f2;

    border: 1px solid #fecaca;

    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;

    border: 1px solid #fde68a;

    color: #92400e;
}

.alert-info {
    background: #eff6ff;

    border: 1px solid #bfdbfe;

    color: #1e40af;
}


/* ============================================================
   6. MAIN APPLICATION LAYOUT
   ============================================================ */

.app-layout {
    min-height: 100vh;

    display: flex;
}

.sidebar {
    width: 250px;

    min-height: 100vh;

    flex-shrink: 0;

    background: #1f2937;

    color: #ffffff;
}

.main-area {
    flex: 1;

    min-width: 0;

    min-height: 100vh;

    display: flex;

    flex-direction: column;
}


/* ============================================================
   7. SIDEBAR BRAND
   ============================================================ */

.sidebar-brand {
    min-height: 82px;

    padding: 18px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    max-width: 65px;

    max-height: 55px;

    object-fit: contain;

    margin-bottom: 8px;
}

.sidebar-brand-name {
    font-size: 18px;

    font-weight: 700;

    line-height: 1.3;
}


/* ============================================================
   8. SIDEBAR NAVIGATION
   ============================================================ */

.sidebar-nav {
    padding: 12px 0;
}

.sidebar-link {
    width: 100%;

    min-height: 44px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding: 11px 20px;

    border: none;

    background: transparent;

    color: #ffffff;

    font-size: 14px;

    text-align: left;

    text-decoration: none;

    cursor: pointer;
}

.sidebar-link:hover {
    background:
        rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    background:
        rgba(255, 255, 255, 0.14);

    font-weight: 700;
}

.sidebar-logout {
    margin-top: 15px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);
}


/* ============================================================
   9. SIDEBAR DROPDOWN
   ============================================================ */

.sidebar-dropdown-button {
    font-family: inherit;
}

.menu-arrow {
    font-size: 9px;

    margin-left: 10px;
}

.sidebar-submenu {
    display: none;

    background:
        rgba(0, 0, 0, 0.16);
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-submenu a {
    display: block;

    padding: 10px 20px 10px 38px;

    color: #dbe3ea;

    font-size: 13px;

    text-decoration: none;
}

.sidebar-submenu a:hover {
    background:
        rgba(255, 255, 255, 0.08);

    color: #ffffff;
}


/* ============================================================
   10. TOP HEADER
   ============================================================ */

.top-header {
    min-height: 82px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 25px;

    background: #ffffff;

    border-bottom:
        1px solid #e1e5e9;
}

.header-company {
    min-width: 0;
}

.header-company-name {
    margin-bottom: 4px;

    font-size: 20px;

    font-weight: 700;

    color: #111827;
}

.header-company-detail {
    margin-top: 2px;

    font-size: 12px;

    color: #6b7280;
}

.header-user {
    flex-shrink: 0;

    text-align: right;
}

.header-date-time {
    margin-bottom: 5px;

    font-size: 12px;

    color: #6b7280;
}

.header-user-name {
    font-size: 14px;

    font-weight: 700;

    color: #1f2937;
}


/* ============================================================
   11. PAGE CONTENT
   ============================================================ */

.page-content {
    flex: 1;

    padding: 25px;
}

.page-heading {
    margin-bottom: 25px;
}

.page-heading h1 {
    margin: 0 0 6px;

    font-size: 28px;

    color: #111827;
}

.page-heading p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   12. DASHBOARD HEADER
   ============================================================ */

.dashboard-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;
}

.dashboard-header h1 {
    margin: 0 0 6px;

    font-size: 28px;

    color: #111827;
}

.dashboard-header p {
    margin: 0;

    color: #6b7280;

    font-size: 14px;
}


/* ============================================================
   13. DASHBOARD CARDS
   ============================================================ */

.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 25px;
}

.dashboard-card {
    min-height: 115px;

    padding: 20px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.04);
}

.dashboard-card-label {
    margin-bottom: 12px;

    color: #6b7280;

    font-size: 13px;

    font-weight: 500;
}

.dashboard-card-value {
    color: #111827;

    font-size: 26px;

    font-weight: 700;
}

.dashboard-card-money .dashboard-card-value {
    font-size: 22px;
}


/* ============================================================
   14. DASHBOARD SECTIONS
   ============================================================ */

.dashboard-section {
    margin-bottom: 25px;

    overflow: hidden;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.dashboard-section-header {
    padding: 20px 22px;

    border-bottom:
        1px solid #e5e7eb;
}

.dashboard-section-header h2 {
    margin: 0 0 5px;

    font-size: 19px;

    color: #111827;
}

.dashboard-section-header p {
    margin: 0;

    color: #6b7280;

    font-size: 13px;
}


/* ============================================================
   15. TABLES
   ============================================================ */

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.data-table {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;
}

.data-table th {
    padding: 13px 18px;

    background: #f8fafc;

    border-bottom:
        1px solid #e5e7eb;

    color: #4b5563;

    font-size: 12px;

    font-weight: 700;

    text-align: left;

    white-space: nowrap;
}

.data-table td {
    padding: 13px 18px;

    border-bottom:
        1px solid #eef0f2;

    color: #374151;

    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.empty-table {
    padding: 35px !important;

    color: #9ca3af !important;

    text-align: center !important;
}


/* ============================================================
   16. ENTRY TYPE
   ============================================================ */

.entry-type {
    font-size: 13px;

    font-weight: 600;
}


/* ============================================================
   17. GENERAL CONTENT BOX
   ============================================================ */

.content-box {
    margin-bottom: 25px;

    padding: 22px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.content-box-title {
    margin: 0 0 18px;

    font-size: 18px;

    font-weight: 700;

    color: #111827;
}


/* ============================================================
   18. FORM LAYOUT
   ============================================================ */

.form-card {
    margin-bottom: 25px;

    padding: 22px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.form-card-title {
    margin: 0 0 20px;

    padding-bottom: 12px;

    border-bottom:
        1px solid #e5e7eb;

    font-size: 18px;

    font-weight: 700;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.form-grid-3 {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.form-grid-4 {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

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

.form-actions {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 20px;

    padding-top: 18px;

    border-top:
        1px solid #e5e7eb;
}


/* ============================================================
   19. SEARCH / FILTER AREA
   ============================================================ */

.filter-card {
    margin-bottom: 20px;

    padding: 18px;

    background: #ffffff;

    border:
        1px solid #e1e5e9;

    border-radius: 8px;
}

.filter-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 15px;
}

.filter-actions {
    display: flex;

    align-items: flex-end;

    gap: 8px;
}


/* ============================================================
   20. ACTION BUTTONS
   ============================================================ */

.action-buttons {
    display: flex;

    align-items: center;

    gap: 6px;

    flex-wrap: wrap;
}

.action-buttons .btn {
    white-space: nowrap;
}


/* ============================================================
   21. FOOTER
   ============================================================ */

.app-footer {
    min-height: 55px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 15px;

    padding: 14px 25px;

    background: #ffffff;

    border-top:
        1px solid #e1e5e9;

    color: #6b7280;

    font-size: 12px;
}


/* ============================================================
   22. STATUS LABELS
   ============================================================ */

.status-label {
    display: inline-block;

    padding: 4px 9px;

    border-radius: 4px;

    font-size: 11px;

    font-weight: 600;
}

.status-active {
    background: #ecfdf5;

    color: #065f46;
}

.status-inactive {
    background: #f3f4f6;

    color: #4b5563;
}

.status-pending {
    background: #fffbeb;

    color: #92400e;
}


/* ============================================================
   23. MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.45);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    width: 100%;

    max-width: 600px;

    max-height: 90vh;

    overflow-y: auto;

    padding: 25px;

    background: #ffffff;

    border-radius: 8px;
}

.modal-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 20px;
}

.modal-title {
    margin: 0;

    font-size: 20px;
}

.modal-close {
    border: none;

    background: transparent;

    font-size: 22px;

    cursor: pointer;
}


/* ============================================================
   24. PRINT
   ============================================================ */

@media print {

    .sidebar,
    .top-header,
    .app-footer,
    .no-print {
        display: none !important;
    }

    .main-area {
        width: 100%;

        min-height: auto;
    }

    .page-content {
        padding: 0;
    }

    body {
        background: #ffffff;
    }

    .content-box,
    .form-card,
    .dashboard-section {
        border: none;

        box-shadow: none;
    }

}


/* ============================================================
   25. RESPONSIVE - TABLET
   ============================================================ */

@media (max-width: 1100px) {

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

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

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

}


/* ============================================================
   26. RESPONSIVE - SMALL TABLET
   ============================================================ */

@media (max-width: 800px) {

    .sidebar {
        width: 215px;
    }

    .top-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .header-user {
        text-align: left;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }

}


/* ============================================================
   27. RESPONSIVE - MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 100%;

        min-height: auto;
    }

    .sidebar-nav {
        max-height: 500px;

        overflow-y: auto;
    }

    .top-header {
        padding: 15px;
    }

    .page-content {
        padding: 15px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;

        gap: 12px;
    }

    .dashboard-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .form-grid,
    .form-grid-4,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;

        flex-direction: column;
    }

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

    .filter-actions {
        align-items: stretch;

        flex-direction: column;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .app-footer {
        padding: 15px;

        align-items: flex-start;

        flex-direction: column;
    }

    .login-box {
        padding: 25px 20px;
    }

}

/* ============================================================
   SIDEBAR MENU ICONS
   ============================================================ */

.sidebar-link-left {
    display: flex;

    align-items: center;

    gap: 11px;

    min-width: 0;
}

.menu-icon {
    width: 22px;

    min-width: 22px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    font-size: 17px;

    line-height: 1;
}

.submenu-icon {
    width: 20px;

    min-width: 20px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-right: 8px;

    font-size: 14px;

    line-height: 1;
}

.sidebar-submenu a {
    display: flex;

    align-items: center;

    padding: 10px 20px 10px 38px;

    color: #dbe3ea;

    font-size: 13px;

    text-decoration: none;
}


/* ============================================================
   END OF SMART LEDGER CSS
   ============================================================ */

/* ============================================================
   Searchable account / party selector
   Adds a compact searchable list while matching existing form fields.
   ============================================================ */
.sl-searchable-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.sl-searchable-select.is-open {
    z-index: 5000;
}

.form-group.sl-searchable-select-active {
    position: relative;
    z-index: 5000;
}

.sl-searchable-select-input {
    display: block;
    width: 100%;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2937;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sl-searchable-select-input:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.10);
}

.sl-searchable-select-input:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.sl-searchable-select-native {
    display: none !important;
}

.sl-searchable-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 5001;
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sl-searchable-select-options[hidden] {
    display: none !important;
}

.sl-searchable-select-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #f0f1f2;
    background: #ffffff;
    color: #1f2937;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.sl-searchable-select-option:last-child {
    border-bottom: 0;
}

.sl-searchable-select-option:hover,
.sl-searchable-select-option.is-active {
    background: #f3f4f6;
}

.sl-searchable-select-option:disabled {
    color: #9ca3af;
    cursor: not-allowed;
}

.sl-searchable-select-empty {
    padding: 12px;
    color: #6b7280;
    font-size: 13px;
}
