/* =========================================================
   AesthetiOS V2
   Professional Medical Aesthetic Operating System
   Common UI Style
   ========================================================= */


/* ---------------------------------------------------------
   1. 全域設定
   --------------------------------------------------------- */

:root {
    --bg-main: #0b0f19;
    --bg-header: #1e293b;
    --bg-panel: #1e293b;
    --bg-panel-dark: #0f172a;
    --bg-input: #080b12;

    --border-main: #334155;
    --border-input: #475569;

    --text-main: #f1f5f9;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;

    --primary: #38bdf8;
    --primary-dark: #0ea5e9;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #eab308;

    --header-height: 64px;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: var(--header-height);

    font-family:
        "Microsoft JhengHei",
        "PingFang TC",
        Arial,
        sans-serif;

    color: var(--text-main);
    background: var(--bg-main);
}


/* ---------------------------------------------------------
   2. 上方固定品牌列
   --------------------------------------------------------- */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: var(--header-height);
    z-index: 1001;

    display: flex;
    align-items: center;

    padding: 0 20px;

    background: var(--bg-header);
    border-bottom: 1px solid var(--border-main);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.menu-btn {
    width: 42px;
    height: 42px;

    margin-right: 15px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);
    background: transparent;

    border: 0;
    border-radius: 8px;

    font-size: 27px;
    cursor: pointer;

    transition: background 0.2s ease;
}

.menu-btn:hover {
    background: rgba(56, 189, 248, 0.12);
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-logo {
    font-size: 25px;
}

.brand-company {
    color: #f0abfc;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-system {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}


/* ---------------------------------------------------------
   3. 側邊選單
   --------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: calc(var(--sidebar-width) * -1);

    width: var(--sidebar-width);
    z-index: 1100;

    padding-top: 18px;

    background: var(--bg-header);
    box-shadow: 7px 0 28px rgba(0, 0, 0, 0.55);

    transition: left 0.25s ease;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 48px;
    padding: 0 20px 16px;

    color: var(--primary);
    font-size: 17px;
    font-weight: 700;

    border-bottom: 1px solid var(--border-main);
}

.close-btn {
    padding: 0;

    color: var(--text-muted);
    background: transparent;

    border: 0;

    font-size: 29px;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

.sidebar-menu {
    margin: 0;
    padding: 10px 0;

    list-style: none;
}

.sidebar-menu a {
    display: block;

    padding: 14px 22px;

    color: var(--text-soft);
    text-decoration: none;
    font-weight: 700;

    border-left: 4px solid transparent;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.sidebar-menu a:hover {
    color: white;
    background: rgba(56, 189, 248, 0.08);
}

.sidebar-menu a.active {
    color: var(--primary);
    background: var(--bg-panel-dark);
    border-left-color: var(--primary);
}

.overlay {
    position: fixed;
    inset: 0;

    z-index: 1050;

    display: none;

    background: rgba(0, 0, 0, 0.65);
}

.overlay.active {
    display: block;
}


/* ---------------------------------------------------------
   4. 主要內容區
   --------------------------------------------------------- */

.page-container {
    width: min(1250px, calc(100% - 40px));
    margin: 30px auto 60px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 15px;
    margin-bottom: 26px;

    border-bottom: 2px solid var(--primary);
}

.page-title {
    margin: 0;

    color: var(--primary);
    font-size: 27px;
    font-weight: 700;
}

.page-code {
    padding: 3px 7px;

    color: #f87171;
    background: rgba(239, 68, 68, 0.06);

    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 5px;

    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
}


/* ---------------------------------------------------------
   5. 共用內容面板
   --------------------------------------------------------- */

.section {
    position: relative;

    margin-bottom: 24px;
    padding: 24px;

    background: var(--bg-panel);

    border: 1px solid var(--border-main);
    border-radius: 12px;

    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.section-title {
    margin-bottom: 20px;
    padding-left: 10px;

    color: var(--primary);
    font-size: 18px;
    font-weight: 700;

    border-left: 4px solid var(--primary);
}

.section-description {
    margin-top: -8px;
    margin-bottom: 18px;

    color: var(--text-muted);
    font-size: 14px;
}


/* ---------------------------------------------------------
   6. 資料表
   --------------------------------------------------------- */

.table-wrapper {
    width: 100%;
    overflow-x: auto;

    border: 1px solid var(--border-main);
    border-radius: 9px;
}

.generic-table {
    width: 100%;
    min-width: 760px;

    border-collapse: collapse;
    table-layout: fixed;

    background: var(--bg-panel-dark);
}

.generic-table th,
.generic-table td {
    padding: 13px 10px;

    color: var(--text-soft);
    text-align: left;
    font-size: 14px;

    border-bottom: 1px solid #293548;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.generic-table th {
    color: var(--primary);
    background: var(--bg-header);

    font-weight: 700;
}

.generic-table tbody tr {
    transition: background 0.15s ease;
}

.generic-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.07);
}

.generic-table tbody tr:last-child td {
    border-bottom: 0;
}

.col-id {
    width: 70px;
    text-align: center !important;

    color: var(--text-muted) !important;
    font-family: Consolas, "Courier New", monospace;
    font-weight: 700;
}

.col-phone {
    width: 160px;
}

.col-group {
    width: 110px;
}

.col-action {
    width: 130px;
    text-align: center !important;
}


/* ---------------------------------------------------------
   7. 顧客姓名與標籤
   --------------------------------------------------------- */

.customer-name {
    color: var(--primary);
    font-weight: 700;
}

.badge {
    display: inline-block;

    padding: 3px 7px;

    border-radius: 5px;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.badge-default {
    color: white;
    background: var(--primary-dark);
}

.badge-vip {
    color: #111827;
    background: var(--warning);
}


/* ---------------------------------------------------------
   8. 按鈕
   --------------------------------------------------------- */

.btn {
    display: inline-block;

    padding: 8px 14px;

    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;

    border: 0;
    border-radius: 6px;

    cursor: pointer;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
}


/* ---------------------------------------------------------
   9. 空資料及系統訊息
   --------------------------------------------------------- */

.empty-message {
    padding: 30px;

    color: var(--text-muted);
    text-align: center;

    background: var(--bg-panel-dark);

    border: 1px dashed var(--border-input);
    border-radius: 9px;
}

.status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 15px;

    color: var(--text-muted);
    font-size: 14px;
}

.status-count {
    color: var(--primary);
    font-weight: 700;
}


/* ---------------------------------------------------------
   10. 響應式畫面
   --------------------------------------------------------- */

@media (max-width: 820px) {
    .brand-system {
        display: none;
    }

    .brand-company {
        font-size: 18px;
    }

    .page-container {
        width: min(100% - 24px, 1250px);
        margin-top: 20px;
    }

    .page-title {
        font-size: 22px;
    }

    .section {
        padding: 17px;
    }
}
.row{
    display:flex;
    gap:24px;
}

.col-4{
    width:28%;
}

.col-8{
    width:72%;
}

/* ==========================================================
   ERP global dropdown keyboard focus — A01 1.00za / A06 1.62
   ========================================================== */
.aesthetios-keyboard-active,
.aesthetios-reference-option.aesthetios-keyboard-active,
.tag-source-option.aesthetios-keyboard-active,
.staff-mega-option.aesthetios-keyboard-active,
.customer-search-result.aesthetios-keyboard-active,
.a02-customer-result.aesthetios-keyboard-active {
    outline: 2px solid rgba(89, 196, 255, 0.95) !important;
    outline-offset: -2px;
    background: rgba(42, 126, 180, 0.32) !important;
    box-shadow: inset 3px 0 0 rgba(91, 214, 255, 0.95) !important;
}
