/*
==============================================================================
PROJECT         : Microstock Submission Manager
FILE            : assets/css/style.css
DESCRIPTION     : Global Application Styles
VERSION         : 2.0.0
AUTHOR          : Shadhin
COPYRIGHT       : © 2026 Shadhin. All Rights Reserved.
==============================================================================
*/

/* ==========================================================================
   GLOBAL VARIABLES
========================================================================== */

:root {
    --navy: #071a2a;
    --navy-2: #0c2338;
    --blue: #1769ff;
    --cyan: #18c9c1;
    --bg: #f4f8fd;
    --line: #dfe7f1;
    --text: #10233f;
    --muted: #71809a;
    --red: #ef4d5f;
    --orange: #f59e0b;
    --green: #16a34a;
    --white: #ffffff;

    /* Database-driven sidebar branding. */
    --sidebar-text: #d8e2ee;
    --sidebar-hover-bg: #1269f4;
    --sidebar-hover-text: #ffffff;
    --sidebar-active-bg: #1269f4;
    --sidebar-active-text: #ffffff;
    --sidebar-section-text: #87a2be;
    --sidebar-divider: #48637b;
    --sidebar-border: #20384c;
    --sidebar-icon: #d8e2ee;
}

/* ==========================================================================
   RESET / BASE
========================================================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        Poppins,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

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

button {
    cursor: pointer;
}

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

/* ==========================================================================
   SIDEBAR
========================================================================== */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 255px;
    background: var(--navy);
    color: var(--sidebar-text);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    min-height: 92px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: var(--white);
    font-weight: 900;
}

.brand-text strong,
.brand-text span,
.brand-text small {
    display: block;
}

.brand-text strong {
    font-size: 15px;
}

.brand-text span {
    margin-top: 2px;
    color: var(--sidebar-hover-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
}

.brand-text small {
    margin-top: 3px;
    color: var(--sidebar-text);
    font-size: 8px;
    font-style: italic;
}

.sidebar-body {
    padding: 15px 10px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 13px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    transition: .15s ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.nav-link.logout-link {
    color: #ff6775;
    margin-top: 10px;
}

.nav-icon {
    width: 22px;
    text-align: center;
}

.nav-arrow {
    margin-left: auto;
    opacity: .7;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 19px 10px 7px;
    color: #87a2be;
    font-size: 10px;
    letter-spacing: 1.6px;
}

.sidebar-section-title i {
    height: 1px;
    flex: 1;
    background: #48637b;
}

.sidebar-divider {
    height: 1px;
    margin: 14px 0;
    background: rgba(255,255,255,.10);
}

/* ==========================================================================
   MAIN WRAPPER / TOPBAR
========================================================================== */

.main-wrapper {
    margin-left: 255px;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 26px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 25px;
    min-width: 0;
}

.sidebar-toggle {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 24px;
}

.global-search {
    width: min(560px, 55vw);
    height: 42px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #edf4fc;
    border-radius: 8px;
    color: #7890ad;
}

.global-search input {
    width: 100%;
    padding: 0 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

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

.topbar-icon {
    border: 0;
    background: transparent;
    color: #f6b400;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8f0ff;
    color: var(--blue);
    font-weight: 800;
}

.user-info strong,
.user-info small {
    display: block;
}

.user-info small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

/* ==========================================================================
   PAGE CONTENT
========================================================================== */

.page-content {
    padding: 24px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-head small {
    color: #68809d;
}

.page-head h1 {
    margin: 3px 0;
    font-size: 25px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 14px;
    color: #6f85a1;
    font-size: 13px;
}

.breadcrumb b {
    color: var(--text);
}

/* ==========================================================================
   COMMON COMPONENTS
========================================================================== */

.muted {
    color: var(--muted);
}

.toolbar,
.sheet-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.btn.primary {
    background: var(--blue);
    color: #ffffff;
}

.btn.soft {
    background: #eaf1f8;
    color: #183654;
}

.btn.danger {
    background: var(--red);
    color: #ffffff;
}

.btn.mini {
    padding: 5px 8px;
}

.panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 20px;
    box-shadow: 0 3px 14px rgba(16,35,63,.04);
}

.panel h2,
.panel h3 {
    margin: 0 0 5px;
}

.panel p {
    margin: 0 0 15px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

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

/* ==========================================================================
   STAT CARDS
========================================================================== */

.cards {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

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

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 3px 13px rgba(16,35,63,.04);
}

.stat-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eaf2ff;
    color: var(--blue);
    font-size: 21px;
    font-weight: 900;
}

.stat-card.cyan .stat-icon {
    background: #e2fbf8;
    color: #0aa89f;
}

.stat-card.purple .stat-icon {
    background: #f0e9ff;
    color: #8052e8;
}

.stat-card.green .stat-icon {
    background: #e4f8ea;
    color: #159447;
}

.stat-card small,
.stat-card span {
    display: block;
}

.stat-card small {
    color: var(--muted);
    font-size: 12px;
}

.stat-card strong {
    display: block;
    margin: 3px 0;
    font-size: 25px;
}

.stat-card span {
    color: #8a97a9;
    font-size: 11px;
}

/* ==========================================================================
   TABLE
========================================================================== */

.table-panel {
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    padding: 12px 10px;
    background: #f5f8fc;
    color: #36516f;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8eef5;
    white-space: nowrap;
}

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

.badge {
    padding: 5px 9px;
    border-radius: 20px;
    background: #e7f0ff;
    color: #1269ef;
    font-size: 11px;
    font-weight: 700;
}

.status-enabled {
    color: #159447;
}

/* ==========================================================================
   FORMS
========================================================================== */

.panel > label,
.modal-card label {
    display: block;
    margin-bottom: 14px;
    color: #3b506b;
    font-size: 12px;
    font-weight: 700;
}

.panel input,
.panel textarea,
.panel select,
.modal-card input,
.modal-card textarea,
.modal-card select {
    width: 100%;
    margin-top: 7px;
    padding: 10px 11px;
    border: 1px solid #d4dfeb;
    border-radius: 8px;
    outline: 0;
    background: #ffffff;
    color: var(--text);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

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

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

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
}

.switch-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.switch-row input {
    width: 18px !important;
    margin: 0 !important;
}

.notice,
.hint {
    padding: 12px;
    border-radius: 9px;
    color: #3d5b7c;
    font-size: 12px;
}

.notice {
    background: #eef6ff;
    border: 1px solid #cfe2ff;
}

.notice.error {
    background: #fff0f2;
    border-color: #ffc7ce;
    color: #b42332;
}

.notice.success {
    background: #edf9f0;
    border-color: #c5eccd;
    color: #176b31;
}

.hint {
    margin-top: 14px;
    background: #eef6ff;
    border: 1px solid #cfe2ff;
}

/* ==========================================================================
   MODAL
========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6,19,34,.62);
}

.modal.open {
    display: flex;
}

.modal-card {
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 22px;
    background: #ffffff;
    border-radius: 14px;
}

.modal-card.large {
    width: min(920px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    margin: 0;
}

.modal-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--text);
    font-size: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

/* ==========================================================================
   TOAST
========================================================================== */

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 500;
    padding: 12px 16px;
    border-radius: 9px;
    background: #10233f;
    color: #ffffff;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: .2s ease;
}

.toast.show {
    opacity: 1;
    transform: none;
}

.toast.error {
    background: #b42332;
}

/* ==========================================================================
   RESPONSIVE
========================================================================== */

body.sidebar-collapsed .sidebar {
    width: 0;
}

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

@media (max-width: 1000px) {

    .sidebar {
        width: 220px;
    }

    .main-wrapper {
        margin-left: 220px;
    }

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

}

@media (max-width: 680px) {

    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-wrapper {
        margin-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: 240px;
    }

    .page-content {
        padding: 15px;
    }

    .topbar {
        padding: 0 14px;
    }

    .global-search {
        width: 45vw;
    }

    .user-info {
        display: none;
    }

    .cards.four,
    .cards.two,
    .form-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .page-head h1 {
        font-size: 21px;
    }

}


/* ==========================================================================
   INSTALLATION PAGE
========================================================================== */

.install {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--bg);
}

.install-card {
    width: min(850px, 100%);
    padding: 30px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(16,35,63,.08);
}

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


/* ==========================================================================
   DATABASE-DRIVEN BRANDING OVERRIDES
========================================================================== */

.sidebar .brand-logo-image {

    width: 54px;

    height: 54px;

    flex: 0 0 54px;

    display: block;

    object-fit: cover;

    border-radius: 0;
}

.sidebar .brand-text strong {

    font-size: 17px;

    line-height: 1.05;

    font-weight: 800;
}

.sidebar .brand-text span {

    margin-top: 3px;

    font-size: 10px;

    line-height: 1;

    font-weight: 800;

    letter-spacing: .35px;
}

.sidebar .brand-text small {

    margin-top: 5px;

    font-size: 8px;

    line-height: 1;

    letter-spacing: 1.8px;

}

.sidebar .nav-link {

    color: var(--sidebar-text);

}

.sidebar .nav-link:hover {

    background: var(--sidebar-hover-bg);

    color: var(--sidebar-hover-text);

}

.sidebar .nav-link.active {

    background: var(--sidebar-active-bg);

    color: var(--sidebar-active-text);

}

.sidebar .nav-link .nav-icon {

    color: var(--sidebar-icon);

}

.sidebar .nav-link:hover .nav-icon,

.sidebar .nav-link.active .nav-icon {

    color: inherit;

}

.sidebar .sidebar-section-title {

    color: var(--sidebar-section-text);

}

.sidebar .sidebar-section-title i {

    background: var(--sidebar-divider);

}

.sidebar .sidebar-divider {

    background: var(--sidebar-border);

}

.sidebar .logout-link {

    color: var(--sidebar-hover-text);

}

.user-avatar.profile-image {

    object-fit: cover;

    padding: 0;

}


/* ==========================================================================
   STANDARD CONFIRMATION MODAL
========================================================================== */

.confirm-modal {

    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 24px;

    background: rgba(15, 23, 42, 0.58);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 160ms ease,
        visibility 160ms ease;
}

.confirm-modal.is-visible {

    opacity: 1;

    visibility: visible;
}

.confirm-modal-card {

    width: min(430px, 100%);

    padding: 30px 30px 26px;

    border: 1px solid rgba(15, 23, 42, 0.08);

    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.22);

    text-align: center;

    transform: translateY(12px) scale(0.98);

    transition: transform 160ms ease;
}

.confirm-modal.is-visible .confirm-modal-card {

    transform: translateY(0) scale(1);
}

.confirm-modal-icon {

    width: 58px;

    height: 58px;

    margin: 0 auto 16px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: #fff1f2;

    color: #ef4444;

    font-size: 27px;

    font-weight: 800;
}

.confirm-modal-title {

    margin: 0;

    color: #14213d;

    font-size: 22px;

    line-height: 1.25;
}

.confirm-modal-message {

    margin: 12px auto 0;

    max-width: 350px;

    color: #64748b;

    font-size: 14px;

    line-height: 1.65;
}

.confirm-modal-actions {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 24px;
}

.confirm-modal-actions button {

    min-height: 46px;

    padding: 10px 16px;

    border: 0;

    border-radius: 10px;

    font: inherit;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 120ms ease,
        opacity 120ms ease;
}

.confirm-modal-actions button:hover {

    transform: translateY(-1px);
}

.confirm-modal-cancel {

    background: #f1f5f9;

    color: #334155;
}

.confirm-modal-confirm {

    background: #ef4444;

    color: #ffffff;
}

@media (max-width: 520px) {

    .confirm-modal-card {

        padding: 24px 20px 20px;
    }

    .confirm-modal-actions {

        grid-template-columns: 1fr;
    }
}


/* Logout label visibility fix. */
.sidebar .logout-link .nav-label {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    color: inherit;
    white-space: nowrap;
}

/* Keep custom confirmation modal above every application layer. */
#globalConfirmModal.confirm-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
}
