/**
 * OLAMI Master Manager — Shared components: cards, buttons, modals, tables
 * File: assets/css/components.css
 */


/* === Tables & scroll wrappers (style.css lines 947-982) === */
        /* --- 3. TABLES & SCROLL (PRESERVED) --- */
        .olami-scroll-wrapper {
            display: block;
            width: 100%;
            overflow-x: auto;
            flex-wrap: nowrap;
            margin-bottom: 20px;
            border: 1px solid var(--border);
            background: var(--surface);
            position: relative;
            box-shadow: var(--shadow-xs);
        }

        .olami-scroll-wrapper .wp-list-table {
            table-layout: auto !important;
            width: 100% !important;
            display: table !important;
        }

        .olami-scroll-wrapper .wp-list-table td,
        .olami-scroll-wrapper .wp-list-table th {
            white-space: nowrap;
            vertical-align: middle;
            padding: 12px 10px !important;
        }

        .olami-scroll-wrapper .wp-list-table tr>th:first-child,
        .olami-scroll-wrapper .wp-list-table tr>td:first-child {
            position: sticky !important;
            left: 0;
            z-index: 10;
            background: var(--surface);
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            border-right: 1px solid var(--border);
        }


/* === Sharp card & clean table (style.css lines 2677-2784) === */
        /* SHARP CARD */
        .os-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 20px;
            box-shadow: var(--shadow-xs);
            transition: border-color 0.2s;
            position: relative;
        }

        .os-card:hover {
            border-color: var(--text);
        }

        .os-card h3 {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            color: var(--text-secondary);
            margin: 0 0 15px 0;
            border-bottom: 1px solid var(--border-light);
            padding-bottom: 10px;
        }

        /* CLEAN KPI */
        .os-kpi {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .os-icon {
            font-size: 20px;
            width: 40px;
            height: 40px;
            background: var(--bg);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text);
            flex-shrink: 0;
        }

        .os-num {
            font-size: 24px;
            font-weight: 800;
            color: var(--text);
            line-height: 1.1;
        }

        .os-label {
            font-size: 11px;
            color: var(--text-secondary);
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* CLEAN TABLE */
        .os-clean-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        .os-clean-table th {
            text-align: left;
            color: var(--text-secondary);
            font-weight: 600;
            padding: 12px 15px;
            border-bottom: 1px solid var(--border);
            background: var(--surface-hover);
            font-size: 11px;
            text-transform: uppercase;
        }

        .os-clean-table td {
            padding: 12px 15px;
            border-bottom: 1px solid var(--border-light);
            color: var(--text);
            vertical-align: middle;
        }

        .os-clean-table tr:last-child td {
            border-bottom: none;
        }

        .os-user-cell {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .os-user-cell img {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--border-light);
        }

        .os-chart-container {
            position: relative;
            height: 220px;
            width: 100%;
        }


/* === Clickable divs & buttons (style.css lines 2785-2846) === */
        /* CLICKABLE DIVS & BUTTONS */
        .os-cat-card {
            display: flex !important;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            height: auto;
            min-height: 100px;
            text-decoration: none !important;
            color: inherit !important;
            border-bottom: 1px solid var(--border) !important;
        }

        .os-cat-card.active {
            background-color: var(--success-bg) !important;
            border-color: var(--success) !important;
        }

        .os-div-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 8px 16px;
            background-color: var(--text);
            color: var(--text-inverse) !important;
            font-size: 13px;
            font-weight: 600;
            border-radius: var(--radius-sm);
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: opacity 0.2s;
            user-select: none;
            text-decoration: none !important;
        }

        .os-div-btn:hover {
            opacity: 0.8;
            color: var(--text-inverse);
        }

        /* STATUS BADGES */
        .os-badge {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 700;
            text-transform: uppercase;
            display: inline-block;
        }

        .os-badge.green {
            background: var(--success-bg);
            color: var(--success-text);
        }

        .os-badge.gray {
            background: var(--bg);
            color: var(--text-secondary);
        }


/* === Modal layout (mobile optimized) (style.css lines 6002-6082) === */
        /* --- NEW MODAL LAYOUT (Mobile Optimized) --- */
        .om-layout-stack {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 15px;
        }

        /* 1. History Bar (Top) */
        .om-history-bar {
            background: var(--bg);
            color: var(--text-secondary);
            padding: 8px 12px;
            border-radius: var(--radius);
            font-size: 12px;
            font-weight: 600;
            text-align: center;
            cursor: pointer;
            border: 1px solid var(--border-light);
            transition: background 0.2s;
        }

        .om-history-bar:hover {
            background: var(--surface-hover);
        }

        /* 2. Dropdown (Middle) */
        .om-full-dropdown {
            width: 100%;
            height: 44px;
            padding: 0 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--surface);
            font-size: 15px;
            color: var(--text);
            -webkit-appearance: none;
            /* Modern iOS look */
        }

        /* 3. Three Buttons Inline (Bottom) */
        .om-inline-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1.2fr;
            /* Date | Time | Save (Save is slightly wider) */
            gap: 8px;
            align-items: center;
        }

        /* Force inputs to match height and fit on one line */
        .om-inline-row input,
        .om-inline-row button {
            width: 100%;
            height: 44px;
            margin: 0 !important;
            padding: 0 5px !important;
            font-size: 13px !important;
            text-align: center;
            border-radius: var(--radius) !important;
            box-sizing: border-box;
        }

        .om-inline-row button {
            background: var(--text);
            color: var(--text-inverse);
            font-weight: bold;
            border: none;
            cursor: pointer;
        }

        /* Mobile Tweak: Tighten gaps if screen is very small */
        @media (max-width: 380px) {
            .om-inline-row {
                gap: 4px;
            }

            .om-inline-row input {
                font-size: 11px !important;
            }
        }
