/* ==========================================================
   MG247 - Global Style

   File       : style.css
   Purpose    : Global Layout + Common Components
   Scope      : All Pages
   Version    : 1.0

========================================================== */

/* ==========================================================
   Theme Tokens
   Loaded from theme.css
========================================================== */

/* ==========================================================
   01. Theme
   Managed by : theme.css
========================================================== */

/* ==========================================================
   02. CSS Variables
   Managed by : theme.css
========================================================== */


/* ==========================================================
   03. Reset
========================================================== */
* {
    box-sizing: border-box;
}

/* ==========================================================
   04. HTML Elements
========================================================== */
body {
    margin: 0;
    font-family: var(--font);
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
    color: var(--text);
    min-height: 100vh;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

/* ==========================================================
   05. Application Layout
========================================================== */
/* Page */

.page-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 20px;
}

/* Header */

.page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Menu */

.menu {
    display: grid;
    gap: 10px;
}

.menu button {
    width: 100%;
}

/* ==========================================================
   06. Typography
========================================================== */

.brand-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--text);
    margin-bottom: 2px;
}

.subtitle,
.small {
    color: var(--text-light);
}

/* ==========================================================
   07. Form Controls
========================================================== */
button,
input,
textarea,
select {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    background: var(--surface-white);
    color: var(--text);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid rgba(166, 124, 82, .18);
    border-color: var(--primary);
}

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

/* ==========================================================
   08. Buttons
========================================================== */
button {
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg,
            var(--accent) 0%,
            var(--accent-2) 100%);
    color: var(--text-on-primary);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    box-shadow: var(--shadow-button);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-button-hover);
}

button.secondary {
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: none;
}

button.secondary:hover {
    box-shadow: none;
}

button.danger {
    background: var(--danger);
}

button.success {
    background: var(--accent-2);
}

/* ==========================================================
   09. Common Components
========================================================== */

.card {
    width: min(100%, 1100px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
}

.form-card {
    margin-top: 18px;
}

/* Brand */

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

.brand-badge {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg,
            var(--primary) 0%,
            var(--primary-hover) 100%);
    color: var(--text-on-primary);
    font-size: 1.3rem;
    box-shadow: 0 8px 18px rgba(122, 74, 26, .2);
}

/* Stack */

.stack,
.list-stack {
    display: grid;
    gap: 12px;
}

.row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.list-stack {
    margin-top: 16px;
}

/* Notice */

.notice {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--warning-bg);
    color: var(--accent-2);
    margin-bottom: 12px;
    border: 1px solid var(--warning-border);
}

.empty-card {
    padding: 22px;
    text-align: center;
    color: var(--text-light);
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

/* ==========================================================
   10. Dialog Components
   Global dialog base : Chưa có
   Module-specific dialog styles nằm tại từng CSS module
========================================================== */

/* ==========================================================
   11. Toast Components
   Managed by : toast.css
========================================================== */


/* ==========================================================
   12. Utilities
========================================================== */

.hidden {
    display: none !important;
}

/* ==========================================================
   13. Responsive
========================================================== */


/* ==========================================================
   13.1 Tablet
   max-width: 1024px
========================================================== */

@media (max-width:1024px) {

    .page-shell {
        padding: 20px 14px;
    }

    .card {
        padding: 20px;
    }

    .page-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-top button {
        width: 100%;
    }
}

/* ==========================================================
   13.2 Mobile
   max-width:768px
========================================================== */
@media (max-width:768px) {

    .page-shell {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }

    .row-actions {
        width: 100%;
    }

    .row-actions button {
        flex: 1 1 100%;
    }

    .stack {
        gap: 10px;
    }

    .brand-block {
        align-items: flex-start;
    }

    .brand-title {
        font-size: 1.2rem;
    }

}

/* ==========================================================
   13.3 Small Mobile
   max-width:480px
========================================================== */

@media (max-width:480px) {
    .page-shell {
        padding: 8px;
    }

    .card {
        padding: 12px;
        border-radius: 14px;
    }

    .brand-badge {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    input,
    textarea,
    select,
    button {
        border-radius: 8px;
    }
}