@import "./_normalize.css";
@import "./_header-base.css";
@import "./_table.css";

/* =========================================================
   OIIO MAIN STYLE
   Generic app shell only.
========================================================= */

/* =========================
   FONT
========================= */

@font-face {
    font-family: "Galyon Bold";
    font-style: normal;
    font-weight: 800;
    src:
        local("Galyon Bold"),
        local("Galyon-Bold"),
        url("../assets/fonts/galyon-bold.woff") format("woff"),
        url("../assets/fonts/galyon-bold.otf") format("opentype");
}

@font-face {
    font-family: "Galyon Regular";
    font-style: normal;
    font-weight: 400;
    src:
        local("Galyon Regular"),
        local("Galyon-Regular"),
        url("../assets/fonts/galyon-regular.woff") format("woff");
}

/* =========================
   DESIGN TOKENS
========================= */

:root {
    --brand: #59c4be;
    --brand-dark: #36aaa4;
    --brand-soft: rgba(89, 196, 190, 0.14);

    --navy-950: #05111f;
    --navy-900: #07172a;
    --navy-850: #081b30;
    --navy-800: #0b2238;

    --text: #101828;
    --muted: #667085;
    --muted-soft: #98a2b3;

    --page-bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.78);

    --line: rgba(7, 23, 42, 0.08);
    --line-strong: rgba(7, 23, 42, 0.12);

    --danger: #e63346;
    --danger-dark: #b42318;

    --warning: #f79009;
    --warning-dark: #b54708;

    --success: #12b76a;
    --success-dark: #067647;

    --normal: #1570ef;
    --normal-dark: #175cd3;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --shadow-soft: 0 12px 30px rgba(7, 23, 42, 0.08);
    --shadow-panel: 0 18px 45px rgba(7, 23, 42, 0.1);

    --sidebar-width: 210px;
    --tablet-sidebar-width: 92px;
}

/* =========================
   RESET / BASE
========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;

    font-family:
        "Figtree",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(89, 196, 190, 0.12), transparent 34%),
        linear-gradient(180deg, #f8fbfc 0%, #eef3f7 100%);

    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================
   APP SHELL
========================= */

.wrapper__base {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header-base {
    position: relative;
    z-index: 1000;
}

.main-content,
.main-content-dashboard,
.page-content {
    min-width: 0;
    flex: 1 0 auto;
}

.main-content-dashboard {
    width: 100%;
    min-height: 100vh;

    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(89, 196, 190, 0.14), transparent 34%),
        linear-gradient(180deg, #f8fbfc 0%, #eef3f7 100%);
}

/* Desktop content offset */
@media (min-width: 992px) {
    .main-content,
    .main-content-dashboard,
    .footer-dashboard {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

/* Tablet sidebar offset */
@media (max-width: 991.98px) and (min-width: 576px) {
    .main-content,
    .main-content-dashboard,
    .footer-dashboard {
        margin-left: var(--tablet-sidebar-width);
        width: calc(100% - var(--tablet-sidebar-width));
    }
}

/* Mobile top nav layout */
@media (max-width: 575.98px) {
    .main-content,
    .main-content-dashboard,
    .footer-dashboard {
        margin-left: 0;
        width: 100%;
    }
}

/* =========================
   GENERIC PAGE CONTAINERS
========================= */

.page-shell {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 22px clamp(14px, 2vw, 28px) 40px;
}

.page-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.84));
    box-shadow: var(--shadow-panel);
}

.page-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
}

.page-title {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1;
    font-weight: 850;
    letter-spacing: -0.04em;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* =========================
   GENERIC FORMS
========================= */

.form-card {
    width: 100%;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    box-shadow: var(--shadow-soft);
}

.form-card[hidden],
[hidden] {
    display: none !important;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.form-field {
    min-width: 0;
}

.form-field--wide {
    grid-column: span 2;
}

.form-label,
.form-field label {
    display: block;
    margin-bottom: 7px;

    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.form-control,
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    border: 1px solid #d0d5dd;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    box-shadow: none;

    font-size: 14px;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.form-control:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(89, 196, 190, 0.16);
    outline: none;
}

.form-help,
.form-text.text-muted {
    display: block;
    margin-top: 6px;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* =========================
   GENERIC BUTTONS
========================= */

.btn,
.oiio-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 12px;

    font-size: 14px;
    font-weight: 850;
    line-height: 1;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease,
        background-color 0.15s ease;
}

.btn:hover,
.oiio-btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.oiio-btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    box-shadow: 0 10px 24px rgba(89, 196, 190, 0.24);
}

.btn-danger,
.oiio-btn--danger {
    color: #ffffff;
    background: linear-gradient(135deg, #f04438, #d92d20);
    box-shadow: 0 10px 24px rgba(217, 45, 32, 0.2);
}

.btn-info,
.oiio-btn--soft {
    color: var(--navy-900);
    background: rgba(89, 196, 190, 0.12);
    border-color: rgba(89, 196, 190, 0.22);
}

.btn:disabled,
.oiio-btn:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

/* =========================
   GENERIC STATES
========================= */

.errors,
.text-danger {
    margin: 0 0 16px;
    padding: 12px 14px;

    border: 1px solid #fecdca;
    border-radius: 14px;
    background: #fffbfa;
    color: var(--danger-dark);

    font-size: 13px;
    font-weight: 750;
}

.dashboard-empty-state,
.empty-state {
    min-height: 78px;
    padding: 18px;

    display: grid;
    gap: 4px;
    justify-items: center;
    align-content: center;

    border: 1px dashed #d0d5dd;
    border-radius: 14px;
    background: #f8fafc;
    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.empty-state strong,
.dashboard-empty-state strong {
    color: var(--navy-900);
    font-size: 13px;
}

/* =========================
   GENERIC MODAL
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1005;

    padding: 48px 12px 16px;
    overflow: hidden;

    background: rgba(7, 23, 42, 0.45);
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    width: min(92vw, 420px);
    max-height: calc(100dvh - 60px);
    margin: 0 auto;
    overflow-y: auto;

    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-panel);

    text-align: left;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* =========================
   FOOTER
========================= */

.footer-dashboard {
    flex-shrink: 0;

    padding: 12px 16px;
    background:
        radial-gradient(circle at top left, rgba(89, 196, 190, 0.18), transparent 36%),
        linear-gradient(135deg, var(--navy-900), var(--navy-950));

    color: rgba(255, 255, 255, 0.78);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-dashboard__inner {
    width: min(100%, 980px);
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    text-align: center;
}

.footer-dashboard__copy {
    display: grid;
    gap: 2px;
}

.footer-dashboard__copy p {
    margin: 0;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.footer-dashboard__powered {
    display: inline-flex;
    align-items: center;
    gap: 4px;

    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);

    color: rgba(255, 255, 255, 0.62);
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.footer-dashboard__powered img {
    width: 45px;
    height: 25px;
    object-fit: contain;
}

@media (max-width: 575.98px) {
    .footer-dashboard {
        padding: 10px 8px;
    }

    .footer-dashboard__inner {
        flex-direction: column;
        gap: 6px;
    }

    .footer-dashboard__powered {
        padding-left: 0;
        border-left: 0;
    }

    .footer-dashboard__copy p {
        font-size: 8.5px;
    }
}

/* =========================
   RESPONSIVE GENERIC
========================= */

@media (max-width: 991.98px) {
    .page-shell {
        padding: 16px 12px 30px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-field--wide {
        grid-column: span 2;
    }
}

@media (max-width: 575.98px) {
    .page-shell {
        padding: 12px 8px 24px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .form-card,
    .page-card,
    .page-panel {
        border-radius: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field--wide {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn,
    .form-actions .oiio-btn {
        width: 100%;
    }

    .footer-dashboard {
        padding: 12px 10px;
    }

    .footer-dashboard__inner {
        flex-direction: column;
        gap: 6px;
    }

    .footer-dashboard__copy p,
    .copyrights-text {
        font-size: 8.5px;
    }
}
