﻿/* ============================================================
   Brod Admin - site.css
   主色：#005aa0（深藍）  輔色：#EA5F25（橘）
   ============================================================ */

:root {
    --brod-primary: #005aa0;
    --brod-primary-dark: #003d6e;
    --brod-primary-light: #1976d2;
    --brod-accent: #EA5F25;
    --brod-sidebar-width: 220px;
    --brod-header-height: 56px;
}

html, body { height: 100%; margin: 0; }
body { background: #f0f2f5; font-size: 14px; font-family: "Microsoft JhengHei", "微軟正黑體", sans-serif; }

/* ---- TOP NAVBAR ---- */
.admin-navbar {
    background: var(--brod-primary);
    height: var(--brod-header-height);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1050;
    display: flex; align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.admin-navbar .brand-logo img { height: 36px; vertical-align: middle; }
.admin-navbar .brand-text {
    color: #fff; font-size: 18px; font-weight: bold;
    letter-spacing: 2px; margin-left: 10px; vertical-align: middle;
}
.admin-navbar .nav-user {
    margin-left: auto; color: rgba(255,255,255,.85); font-size: 13px;
    display: flex; align-items: center; gap: 12px;
}
.admin-navbar .nav-user .user-name { color: #ffe082; font-weight: 600; }
.admin-navbar .btn-logout {
    background: var(--brod-accent); border: 0; color: #fff;
    padding: 4px 14px; border-radius: 3px; font-size: 13px; cursor: pointer;
}
.admin-navbar .btn-logout:hover { background: #c94e1e; }

/* ---- SIDEBAR (Tree Nav) ---- */
.admin-sidebar {
    width: var(--brod-sidebar-width);
    background: var(--brod-primary-dark);
    position: fixed; top: var(--brod-header-height); bottom: 0; left: 0;
    overflow-y: auto; z-index: 1040;
    transition: width .25s ease;
}

/* ── 樹狀導覽 ── */
.tree-nav { padding: 6px 0 20px; }

.tree-group { border-bottom: 1px solid rgba(255,255,255,.07); }

.tree-group-toggle {
    width: 100%; background: none; border: 0; cursor: pointer;
    display: flex; align-items: center; gap: 7px;
    padding: 11px 16px 11px 14px;
    color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600;
    letter-spacing: .5px;
    transition: background .15s;
    text-align: left;
}
.tree-group-toggle:hover { background: rgba(255,255,255,.08); }

/* 資料夾圖示：展開/收合 */
.tree-icon-open   { color: #ffd54f; font-size: 15px; display: none; }
.tree-icon-closed { color: #ffb74d; font-size: 15px; display: inline; }
.tree-group.expanded .tree-icon-open   { display: inline; }
.tree-group.expanded .tree-icon-closed { display: none; }

/* 展開箭頭 */
.tree-chevron { font-size: 11px; color: rgba(255,255,255,.4); transition: transform .2s; }
.tree-group.expanded .tree-chevron { transform: rotate(180deg); }

/* 子項清單：高度動畫 */
.tree-children {
    list-style: none; margin: 0; padding: 0;
    overflow: hidden; max-height: 0;
    transition: max-height .25s ease;
    background: rgba(0,0,0,.18);
}

/* 子項連結 */
.tree-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 18px 9px 36px;
    color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px;
    border-left: 3px solid transparent;
    transition: all .15s ease;
}
.tree-item i { font-size: 12px; color: rgba(255,255,255,.45); }
.tree-item:hover { background: rgba(255,255,255,.07); color: #fff; border-left-color: var(--brod-accent); }
.tree-item.active {
    background: rgba(255,255,255,.12);
    color: #fff; border-left-color: var(--brod-accent);
    font-weight: 600;
}
.tree-item.active i { color: var(--brod-accent); }
/* ──────────── */

/* ---- MAIN CONTENT ---- */
.admin-main {
    margin-left: var(--brod-sidebar-width);
    margin-top: var(--brod-header-height);
    min-height: calc(100vh - var(--brod-header-height));
    padding: 24px 28px;
    transition: margin-left .25s ease;
}

/* ---- PAGE TITLE BAR ---- */
.page-title-bar {
    background: #fff; border-radius: 6px;
    padding: 14px 20px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    border-left: 4px solid var(--brod-primary);
}
.page-title-bar h4 { margin: 0; color: var(--brod-primary); font-size: 18px; font-weight: 600; }
.page-title-bar .breadcrumb { margin: 0; background: none; padding: 0; font-size: 12px; }

/* ---- CARD / PANEL ---- */
.admin-card {
    background: #fff; border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 20px; margin-bottom: 20px;
}
.admin-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid #e8edf2;
}
.admin-card-header h5 { margin: 0; color: #333; font-size: 15px; }

/* ---- DASHBOARD STATS ---- */
.stat-card {
    background: #fff; border-radius: 8px;
    padding: 22px 20px; box-shadow: 0 1px 6px rgba(0,0,0,.08);
    display: flex; align-items: center; gap: 16px;
}
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: #222; }
.stat-card .stat-label { font-size: 13px; color: #888; margin-top: 2px; }

/* ---- FOOTER ---- */
.admin-footer {
    margin-left: var(--brod-sidebar-width);
    background: #fff; border-top: 1px solid #e5e5e5;
    text-align: center; padding: 10px;
    font-size: 12px; color: #aaa;
}

/* ---- LOGIN PAGE ---- */
.login-page {
    min-height: 100vh;
    background: url(/images/login/bg-wrapper.jpg) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.login-box {
    background: #fff; border-radius: 10px;
    width: 380px; padding: 40px 36px;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.login-box .login-logo {
    text-align: center; margin-bottom: 20px;
}
.login-box .login-logo img { height: 70px; }
.login-box .login-title {
    text-align: center; color: var(--brod-primary);
    font-size: 18px; font-weight: 700; letter-spacing: 3px;
    margin-bottom: 28px;
}
.login-box .form-label { font-size: 13px; color: #555; }
.login-box .form-control { border-radius: 4px; font-size: 14px; }
.login-box .btn-login {
    background: var(--brod-accent); border: 0; color: #fff;
    width: 100%; padding: 11px; font-size: 16px;
    border-radius: 4px; letter-spacing: 2px;
    box-shadow: 0 2px 8px rgba(234,95,37,.4);
}
.login-box .btn-login:hover { background: #c94e1e; }

/* ---- TABLE ---- */
.table-admin thead th {
    background: var(--brod-primary); color: #fff;
    font-weight: 500; font-size: 13px; border: 0;
    white-space: nowrap;
}
.table-admin tbody tr:hover { background: #f0f6ff; }

/* ---- UTIL ---- */
.text-primary-brod { color: var(--brod-primary) !important; }
.bg-primary-brod { background: var(--brod-primary) !important; }

/* ============================================================
   對齊舊後台 (RadControls) 版型：查詢面板 / 工具列 / 動作按鈕
   ============================================================ */

/* ---- 查詢面板 (舊站 well well-sm) ---- */
.brod-toolbar {
    background: #f5f7fa; border: 1px solid #e3e8ee; border-radius: 6px;
    padding: 12px 16px; margin-bottom: 14px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
}
.brod-toolbar label { margin: 0; font-size: 13px; color: #555; font-weight: 600; }
.brod-toolbar .k-textbox,
.brod-toolbar input[type=text] { height: 32px; }
.brod-toolbar .brod-toolbar-spacer { flex: 1 1 auto; }

/* ---- 動作列 (新增鈕靠右) ---- */
.brod-actions-bar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px; margin-bottom: 12px;
}
.brod-actions-bar.left { justify-content: flex-start; }

/* ---- 綠色「新增」按鈕 (舊站 SkinID=Add) ---- */
.btn-brod-add {
    background: #5cb85c; border: 0; color: #fff !important;
    padding: 7px 20px; border-radius: 4px; font-size: 14px;
    cursor: pointer; text-decoration: none; display: inline-flex;
    align-items: center; gap: 6px; line-height: 1.4;
}
.btn-brod-add:hover { background: #4cae4c; color: #fff; }

/* ---- 藍色「查詢」按鈕 (舊站 SkinID=Search) ---- */
.btn-brod-search {
    background: var(--brod-primary-light); border: 0; color: #fff !important;
    padding: 6px 22px; border-radius: 4px; font-size: 14px; cursor: pointer;
}
.btn-brod-search:hover { background: var(--brod-primary); color: #fff; }
.btn-brod-clear {
    background: #f0ad4e; border: 0; color: #fff !important;
    padding: 6px 18px; border-radius: 4px; font-size: 14px; cursor: pointer;
}
.btn-brod-clear:hover { background: #ec971f; color: #fff; }

/* ---- Grid 內動作圖示按鈕 (舊站 ImageButton edit/delete/role...) ---- */
.grid-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 4px; border: 0;
    cursor: pointer; margin: 0 1px; color: #fff; font-size: 13px;
    text-decoration: none; vertical-align: middle;
}
.grid-action i { pointer-events: none; }
.grid-action.act-edit   { background: #f0ad4e; }
.grid-action.act-edit:hover { background: #ec971f; }
.grid-action.act-del    { background: #d9534f; }
.grid-action.act-del:hover { background: #c9302c; }
.grid-action.act-role   { background: #5bc0de; }
.grid-action.act-role:hover { background: #31b0d5; }
.grid-action.act-perm   { background: #7e57c2; }
.grid-action.act-perm:hover { background: #673ab7; }
.grid-action.act-acc    { background: #26a69a; }
.grid-action.act-acc:hover { background: #00897b; }
.grid-action.act-photo  { background: var(--brod-primary-light); }
.grid-action.act-photo:hover { background: var(--brod-primary); }
.grid-action.act-preview{ background: #78909c; }
.grid-action.act-preview:hover { background: #546e7a; }
.grid-action.act-up,
.grid-action.act-down   { background: #66bb6a; }
.grid-action.act-up:hover,
.grid-action.act-down:hover { background: #4caf50; }
.grid-action[disabled] { background: #cfd8dc; cursor: default; }

/* ---- 標籤色塊 (專案標籤) ---- */
.brod-tag {
    display: inline-block; padding: 3px 12px; border-radius: 4px;
    color: #fff; font-size: 13px; font-weight: 600;
}

/* ---- 封面 / 縮圖 ---- */
.brod-cover-thumb {
    width: 64px; height: 51px; object-fit: cover; border: 1px solid #ddd;
    border-radius: 3px; background: #fafafa;
}
.brod-screen-thumb {
    max-width: 80px; max-height: 60px; border: 1px solid #ddd;
    border-radius: 3px; cursor: pointer;
}

/* ---- 表單 (舊站 table_form) ---- */
.brod-form-table { width: 100%; border-collapse: collapse; }
.brod-form-table th {
    width: 130px; text-align: right; padding: 10px 14px; vertical-align: middle;
    background: #eef2f7; color: #34495e; font-weight: 600; font-size: 13px;
    border-bottom: 1px solid #fff;
}
.brod-form-table td {
    padding: 10px 14px; background: #f7f9fb; border-bottom: 1px solid #fff;
}
.brod-form-table .mark-star { color: #e53935; margin-left: 3px; }
.brod-form-buttons { text-align: center; padding: 16px 0 4px; gap: 8px; display: flex; justify-content: center; align-items: center; }

/* ---- 取消/次要按鈕 (全站統一：Kendo 2022 的 .k-button 需補樣式) ---- */
button.k-button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 22px; border-radius: 4px; font-size: 14px; cursor: pointer;
    border: 1px solid #d0d0d0; background: #f5f5f5; color: #424242;
    line-height: 1.4; min-width: 80px; vertical-align: middle;
    transition: background .15s;
}
button.k-button:hover { background: #e0e0e0; border-color: #b0b0b0; }
button.k-button:active { background: #d0d0d0; }

/* ---- 樹狀 + Grid 兩欄版型 (部門管理 / 網站架構) ---- */
.brod-tree-layout { display: flex; gap: 16px; align-items: flex-start; }
.brod-tree-pane {
    width: 300px; flex: 0 0 300px; background: #fff; border: 1px solid #e3e8ee;
    border-radius: 6px; padding: 12px; min-height: 480px;
}
.brod-grid-pane { flex: 1 1 auto; min-width: 0; }
