/* ===== Operations Module Styles ===== */

/* --- Navigation --- */
.ops-nav {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
}
.ops-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    text-decoration: none;
    transition: all .15s ease;
}
.ops-nav-item:hover {
    background: #e2e8f0;
    color: #334155;
    text-decoration: none;
}
.ops-nav-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    font-weight: 600;
}
.ops-nav-active:hover {
    background: #fff;
}
.ops-nav-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

/* --- Page Layout --- */
.ops-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}
.ops-page-header {
    margin-bottom: 24px;
}
.ops-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}
.ops-page-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* --- Cards --- */
.ops-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ops-card-header {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

/* --- Stat Cards --- */
.ops-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.ops-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ops-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.ops-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}
.ops-stat-blue   { border-left: 4px solid #3b82f6; }
.ops-stat-green  { border-left: 4px solid #10b981; }
.ops-stat-purple { border-left: 4px solid #8b5cf6; }
.ops-stat-orange { border-left: 4px solid #f59e0b; }
.ops-stat-red    { border-left: 4px solid #ef4444; }
.ops-stat-cyan   { border-left: 4px solid #06b6d4; }

/* --- Tables --- */
.ops-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    background: #fff;
}
.ops-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ops-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.ops-table td {
    padding: 10px 16px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.ops-table tbody tr:hover {
    background: #f8fafc;
}
.ops-table tbody tr:last-child td {
    border-bottom: none;
}
.ops-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* --- Forms --- */
.ops-form-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}
.ops-form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ops-form-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 768px) {
    .ops-form-grid-4, .ops-form-grid-5 {
        grid-template-columns: 1fr;
    }
}
.ops-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.ops-input,
.ops-select {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}
.ops-input:focus,
.ops-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.ops-input::placeholder {
    color: #94a3b8;
}

/* --- Buttons --- */
.ops-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    box-sizing: border-box;
}
.ops-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.ops-btn:active { transform: translateY(0); }

.ops-btn-primary {
    background: #3b82f6 !important;
    color: #fff !important;
}
.ops-btn-primary:hover { background: #2563eb !important; color: #fff !important; }

.ops-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.ops-btn-secondary:hover { background: #e2e8f0; color: #334155; }

.ops-btn-success {
    background: #10b981 !important;
    color: #fff !important;
}
.ops-btn-success:hover { background: #059669 !important; color: #fff !important; }

.ops-btn-dark {
    background: #1e293b;
    color: #fff;
}
.ops-btn-dark:hover { background: #0f172a; color: #fff; }

.ops-btn-outline {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
}
.ops-btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

.ops-btn-block {
    display: flex;
    width: 100%;
}

/* --- Alerts / Messages --- */
.ops-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}
.ops-alert i { margin-top: 2px; flex-shrink: 0; }
.ops-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.ops-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.ops-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* --- Menu Grid (index page) --- */
.ops-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.ops-menu-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: #0f172a;
    transition: all .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.ops-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    border-color: #cbd5e1;
    text-decoration: none;
    color: #0f172a;
}
.ops-menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ops-menu-icon-blue   { background: #dbeafe; color: #2563eb; }
.ops-menu-icon-green  { background: #d1fae5; color: #059669; }
.ops-menu-icon-purple { background: #ede9fe; color: #7c3aed; }
.ops-menu-icon-orange { background: #fef3c7; color: #d97706; }
.ops-menu-icon-red    { background: #fee2e2; color: #dc2626; }
.ops-menu-icon-cyan   { background: #cffafe; color: #0891b2; }
.ops-menu-text { flex: 1; min-width: 0; }
.ops-menu-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}
.ops-menu-desc {
    font-size: 12px;
    color: #94a3b8;
}

/* --- Top Page --- */
.ops-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}
.ops-top-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    color: #0f172a;
    transition: all .2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ops-top-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    text-decoration: none;
    color: #0f172a;
}
.ops-top-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.ops-top-label {
    font-size: 18px;
    font-weight: 700;
}
.ops-top-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 2px;
}

/* --- Toolbar row --- */
.ops-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* --- Badge --- */
.ops-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.ops-badge-green  { background: #d1fae5; color: #065f46; }
.ops-badge-yellow { background: #fef3c7; color: #92400e; }
.ops-badge-red    { background: #fee2e2; color: #991b1b; }

/* --- Tab Group --- */
.ops-tab-group {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.ops-tab {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    font-family: inherit;
}
.ops-tab:hover {
    color: #334155;
    background: #e2e8f0;
}
.ops-tab-active {
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    font-weight: 600;
}

/* --- Inline Nav (prev/next) --- */
.ops-inline-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- Small Button --- */
.ops-btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

/* --- Report (A4 Print) --- */
.report-wrap { max-width: 210mm; margin: 0 auto; background: #fff; }
.report-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.report-meta { margin-bottom: 16px; color: #64748b; font-size: 14px; }

@media print {
    .ops-nav, .no-print { display: none !important; }
    .ops-page { padding: 0; max-width: 100%; }
}

/* ===== Sidebar Layout ===== */

:root {
    --sidebar-width: 220px;
}

body.ops-layout {
    margin: 0;
    background: #f8fafc;
    display: flex;
    min-height: 100vh;
    font-family: 'Noto Sans JP', sans-serif;
}

/* --- Sidebar --- */
.ops-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 200;
    transition: transform .25s ease;
}

.ops-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.ops-sidebar-brand i {
    font-size: 18px;
    color: #3b82f6;
}

.ops-sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.ops-sidebar-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    padding: 6px 10px 4px;
    margin: 0;
}

.ops-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    text-decoration: none;
    transition: all .15s ease;
    margin-bottom: 2px;
}
.ops-sidebar-link:hover {
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
    text-decoration: none;
}
.ops-sidebar-active {
    background: rgba(59,130,246,.15);
    color: #93c5fd;
    font-weight: 600;
}
.ops-sidebar-active:hover {
    background: rgba(59,130,246,.2);
    color: #93c5fd;
}
.ops-sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}
.ops-sidebar-logout:hover {
    color: #fca5a5;
    background: rgba(239,68,68,.1);
}

.ops-sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

/* --- Main content area --- */
.ops-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}
.ops-content {
    padding: 0;
}
/* ops-page padding adjustments inside sidebar layout */
body.ops-layout .ops-page {
    max-width: 100%;
}

/* --- Mobile header --- */
.ops-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: #0f172a;
    color: #fff;
    z-index: 150;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.ops-mobile-title {
    font-size: 16px;
    font-weight: 600;
}
.ops-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* --- Overlay (mobile) --- */
.ops-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 190;
}
.ops-overlay.ops-overlay-show {
    display: block;
}

/* --- Mobile breakpoint --- */
@media (max-width: 768px) {
    body.ops-layout {
        flex-direction: column;
    }
    .ops-sidebar {
        transform: translateX(-100%);
    }
    .ops-sidebar.ops-sidebar-open {
        transform: translateX(0);
    }
    .ops-mobile-header {
        display: flex;
    }
    .ops-main {
        margin-left: 0;
        margin-top: 54px;
    }
}

/* --- Print override --- */
@media print {
    .ops-sidebar, .ops-mobile-header, .ops-overlay, .no-print { display: none !important; }
    .ops-main { margin-left: 0; }
    body.ops-layout { background: #fff; }
}
