/*
==================================================
OPS UI FOUNDATION

Version:
R0.7.0

Status:
Foundation

Maintainer:
INSODEMA Systems

Purpose:
Gemeinsame UI-Basis für OPS R, OPS Core,
OPS SaaS und spätere mobile Arbeitsansichten.

Grundregel:
Diese Datei enthält nur allgemeine UI-Bausteine.
Modulspezifische Sonderregeln gehören später in
eigene Dateien wie finance.css, dispatcher.css
oder analytics.css.
==================================================
*/


/* ==================================================
   01. Corporate Colors / Design Tokens
================================================== */

:root {
    --ops-blue: #1f5fa8;
    --ops-blue-dark: #174a82;
    --ops-blue-soft: #eef5fc;

    --ops-orange: #f59e0b;
    --ops-orange-soft: #fff7e6;

    --ops-green: #16a34a;
    --ops-green-soft: #edf9f0;

    --ops-red: #dc2626;
    --ops-red-soft: #fff1f1;

    --ops-text: #243447;
    --ops-text-soft: #475569;
    --ops-muted: #64748b;

    --ops-border: #d9e1ea;
    --ops-border-soft: #e5e7eb;

    --ops-surface: #ffffff;
    --ops-surface-soft: #f8fafc;
    --ops-surface-muted: #f1f5f9;

    --ops-radius-sm: 4px;
    --ops-radius-md: 6px;
    --ops-radius-lg: 10px;

    --ops-space-xs: 4px;
    --ops-space-sm: 8px;
    --ops-space-md: 14px;
    --ops-space-lg: 20px;
    --ops-space-xl: 28px;

    --ops-font-main: Arial, sans-serif;
}


/* ==================================================
   02. Reset / Base
================================================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--ops-font-main);
    color: var(--ops-text);
    background: var(--ops-surface-soft);
}

a {
    color: var(--ops-blue);
}

a:hover {
    color: var(--ops-blue-dark);
}

small {
    color: var(--ops-muted);
}

hr {
    border: 0;
    border-top: 1px solid var(--ops-border-soft);
    margin: var(--ops-space-lg) 0;
}

/* ==================================================
   03. Page Layout
================================================== */

.ops-page {

    max-width: 1500px;

    margin: 0 auto;

    padding: 24px;

}


.ops-container {

    width: 100%;

}


.ops-content {

    margin-top: var(--ops-space-lg);

}



/* ==================================================
   04. Page Header
================================================== */

.ops-page-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: var(--ops-space-lg);

    margin-bottom: 28px;

}


.ops-page-title {

    margin: 0;

    font-size: 30px;

    font-weight: 700;

}


.ops-page-subtitle {

    margin-top: 6px;

    color: var(--ops-muted);

    line-height: 1.45;

}


.ops-page-actions {

    display: flex;

    gap: var(--ops-space-sm);

    flex-wrap: wrap;

    align-items: center;

}



/* ==================================================
   05. Section Header
================================================== */

.ops-section-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 16px;

}


.ops-section-title {

    margin: 0;

    font-size: 20px;

    font-weight: 600;

}


.ops-section-actions {

    display: flex;

    gap: 8px;

}



/* ==================================================
   06. Footer
================================================== */

.ops-footer {

    margin-top: 50px;

    padding-top: 20px;

    padding-bottom: 20px;

    border-top: 1px solid var(--ops-border);

    color: var(--ops-muted);

    font-size: 13px;

}


.ops-footer-content {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    flex-wrap: wrap;

}


.ops-footer-left {

    display: flex;

    flex-direction: column;

    gap: 4px;

}


.ops-footer-right {

    text-align: right;

}


.ops-version {

    font-weight: 600;

    color: var(--ops-text);

}

/* ==================================================
   07. Cards
================================================== */

.ops-card {
    margin-bottom: var(--ops-space-lg);
    padding: 18px;
    border: 1px solid var(--ops-border);
    border-radius: var(--ops-radius-lg);
    background: var(--ops-surface);
}

.ops-card h2 {
    margin: 0 0 16px;
    font-size: 19px;
    font-weight: 600;
}

.ops-card-muted {
    background: var(--ops-surface-muted);
}

.ops-card-blue {
    border-top: 4px solid var(--ops-blue);
}

.ops-card-orange {
    border-top: 4px solid var(--ops-orange);
}

.ops-card-green {
    border-top: 4px solid var(--ops-green);
}

.ops-card-red {
    border-top: 4px solid var(--ops-red);
}


/* ==================================================
   08. Grids
================================================== */

.ops-grid {
    display: grid;
    gap: var(--ops-space-md);
}

.ops-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ops-space-md);
}

.ops-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ops-space-md);
}

.ops-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--ops-space-md);
}

.ops-grid-full {
    grid-column: 1 / -1;
}


/* ==================================================
   09. Flex Helpers
================================================== */

.ops-flex {
    display: flex;
}

.ops-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ops-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ops-space-sm);
}

/* ==================================================
   10. Forms
================================================== */

.ops-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ops-field label {
    font-size: 12px;
    color: var(--ops-muted);
}

.ops-input,
.ops-select,
.ops-textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: var(--ops-radius-md);
    background: #ffffff;
    color: var(--ops-text);
    font: inherit;
}

.ops-textarea {
    min-height: 120px;
    resize: vertical;
}

.ops-input:focus,
.ops-select:focus,
.ops-textarea:focus {
    outline: 2px solid rgba(31, 95, 168, 0.18);
    border-color: var(--ops-blue);
}

.ops-input[readonly],
.ops-select[disabled],
.ops-textarea[readonly] {
    background: var(--ops-surface-muted);
    color: var(--ops-text-soft);
}

.ops-form-note {
    margin-top: 6px;
    color: var(--ops-muted);
    font-size: 12px;
}

.ops-location-preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--ops-border);
    border-radius: var(--ops-radius-md);
    background: var(--ops-blue-soft);
    color: #35516e;
    font-size: 14px;
}

/* ==================================================
   11. Buttons
================================================== */

.ops-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ops-space-sm);
    margin-top: var(--ops-space-lg);
}

.ops-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 38px;

    padding: 8px 16px;

    border: 1px solid transparent;

    border-radius: var(--ops-radius-md);

    cursor: pointer;

    text-decoration: none;

    font: inherit;

    transition: background .15s ease,
                border-color .15s ease,
                color .15s ease;

}

.ops-button:hover {

    text-decoration: none;

}


/* ---------- Primary ---------- */

.ops-button-primary {

    background: var(--ops-blue);

    color: #fff;

}

.ops-button-primary:hover {

    background: var(--ops-blue-dark);

}


/* ---------- Secondary ---------- */

.ops-button-secondary {

    background: #fff;

    color: var(--ops-text);

    border-color: var(--ops-border);

}

.ops-button-secondary:hover {

    background: var(--ops-surface-muted);

}


/* ---------- Success ---------- */

.ops-button-success {

    background: var(--ops-green);

    color: #fff;

}


/* ---------- Warning ---------- */

.ops-button-warning {

    background: var(--ops-orange);

    color: #fff;

}


/* ---------- Danger ---------- */

.ops-button-danger {

    background: var(--ops-red);

    color: #fff;

}


/* ---------- Small ---------- */

.ops-button-small {

    min-height: 30px;

    padding: 4px 10px;

    font-size: 13px;

}


/* ---------- Large ---------- */

.ops-button-large {

    min-height: 46px;

    padding: 12px 22px;

}

/* ==================================================
   12. Tables
================================================== */

.ops-table-wrap {

    width: 100%;

    overflow-x: auto;

}

.ops-table {

    width: 100%;

    border-collapse: collapse;

    background: #ffffff;

}

.ops-table thead {

    background: var(--ops-surface-muted);

}

.ops-table th {

    padding: 12px;

    text-align: left;

    font-size: 13px;

    font-weight: 600;

    color: var(--ops-text-soft);

    border-bottom: 2px solid var(--ops-border);

    white-space: nowrap;

}

.ops-table td {

    padding: 10px 12px;

    border-bottom: 1px solid var(--ops-border-soft);

    vertical-align: top;

}

.ops-table tbody tr {

    transition: background .15s ease;

}

.ops-table tbody tr:hover {

    background: var(--ops-blue-soft);

}

.ops-table tbody tr:last-child td {

    border-bottom: none;

}


/* ---------- Compact Table ---------- */

.ops-table-compact th,
.ops-table-compact td {

    padding: 6px 8px;

}


/* ---------- Numeric Columns ---------- */

.ops-table-number {

    text-align: right;

    white-space: nowrap;

}


/* ---------- Center ---------- */

.ops-table-center {

    text-align: center;

}


/* ---------- Empty State ---------- */

.ops-empty {

    padding: 32px;

    text-align: center;

    color: var(--ops-muted);

    font-style: italic;

}


/* ==================================================
   13. Lists
================================================== */

.ops-list {

    margin: 0;

    padding: 0;

    list-style: none;

}

.ops-list li {

    padding: 10px 0;

    border-bottom: 1px solid var(--ops-border-soft);

}

.ops-list li:last-child {

    border-bottom: none;

}

/* ==================================================
   14. Status
================================================== */

.ops-status {
    font-weight: 600;
}

.ops-status-avisiert,
.ops-status-offen {
    color: var(--ops-blue);
}

.ops-status-in-arbeit,
.ops-status-erwartet {
    color: #b45309;
}

.ops-status-erledigt,
.ops-status-bezahlt {
    color: var(--ops-green);
}

.ops-status-abgesagt {
    color: var(--ops-red);
}


/* ==================================================
   15. Badges
================================================== */

.ops-badge {

    display: inline-block;

    padding: 4px 10px;

    border-radius: 999px;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;

}

.ops-badge-blue {

    background: var(--ops-blue-soft);

    color: var(--ops-blue);

}

.ops-badge-orange {

    background: var(--ops-orange-soft);

    color: #b45309;

}

.ops-badge-green {

    background: var(--ops-green-soft);

    color: var(--ops-green);

}

.ops-badge-red {

    background: var(--ops-red-soft);

    color: var(--ops-red);

}

.ops-badge-gray {

    background: var(--ops-surface-muted);

    color: var(--ops-text-soft);

}


/* ==================================================
   16. Alerts
================================================== */

.ops-alert {

    padding: 14px 16px;

    border-radius: var(--ops-radius-md);

    margin-bottom: 18px;

    border-left: 5px solid transparent;

}

.ops-alert-info {

    background: var(--ops-blue-soft);

    border-left-color: var(--ops-blue);

}

.ops-alert-success {

    background: var(--ops-green-soft);

    border-left-color: var(--ops-green);

}

.ops-alert-warning {

    background: var(--ops-orange-soft);

    border-left-color: var(--ops-orange);

}

.ops-alert-danger {

    background: var(--ops-red-soft);

    border-left-color: var(--ops-red);

}

/* ==================================================
   17. KPI Components
================================================== */

.ops-kpi-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(220px,1fr));

    gap: 18px;

}

.ops-kpi {

    background: #ffffff;

    border: 1px solid var(--ops-border);

    border-radius: var(--ops-radius-lg);

    padding: 18px;

}

.ops-kpi-title {

    font-size: 12px;

    color: var(--ops-muted);

    text-transform: uppercase;

    letter-spacing: .04em;

}

.ops-kpi-value {

    margin-top: 8px;

    font-size: 30px;

    font-weight: 700;

    color: var(--ops-text);

}

.ops-kpi-subtitle {

    margin-top: 6px;

    font-size: 13px;

    color: var(--ops-muted);

}

/* ==================================================
   18. Utility Classes
================================================== */

.ops-hidden {

    display: none !important;

}

.ops-text-left {

    text-align: left;

}

.ops-text-center {

    text-align: center;

}

.ops-text-right {

    text-align: right;

}

.ops-fw-bold {

    font-weight: bold;

}

.ops-muted {

    color: var(--ops-muted);

}

.ops-full-width {

    width: 100%;

}

.ops-mt-0 {

    margin-top: 0;

}

.ops-mt-sm {

    margin-top: var(--ops-space-sm);

}

.ops-mt-md {

    margin-top: var(--ops-space-md);

}

.ops-mt-lg {

    margin-top: var(--ops-space-lg);

}

.ops-mb-0 {

    margin-bottom: 0;

}

.ops-mb-sm {

    margin-bottom: var(--ops-space-sm);

}

.ops-mb-md {

    margin-bottom: var(--ops-space-md);

}

.ops-mb-lg {

    margin-bottom: var(--ops-space-lg);

}

/* ==================================================
   19. Responsive Foundation
================================================== */

/*
Desktop
> 1200 px

Notebook
1024-1200 px

Tablet
768-1024 px

Phone
< 768 px

OPS bleibt Desktop-first.
Die Mobile-Ansicht wird später für Dispatcher,
Today-Tasks und Außendienst optimiert.
*/

@media (max-width:1200px){

    .ops-page{

        max-width:100%;

    }

}

@media (max-width:1024px){

    .ops-grid-4{

        grid-template-columns:repeat(2,1fr);

    }

}

@media (max-width:768px){

    .ops-page{

        padding:16px;

    }

    .ops-page-header{

        flex-direction:column;

        align-items:flex-start;

    }

    .ops-page-actions{

        width:100%;

    }

    .ops-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ops-space-md);
    }

    .ops-grid-3,
    .ops-grid-4{

        grid-template-columns:1fr;

    }

    .ops-footer-content{

        flex-direction:column;

        align-items:flex-start;

    }

    .ops-table{

        font-size:14px;

    }

    .ops-button{

        width:100%;

    }

}

/* ==================================================
   End of OPS UI Foundation
================================================== */

/* ==================================================
   20. OPS Stepper
================================================== */

.ops-stepper {

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 20px;

    margin: 0;

}

.ops-step {

    background: #ffffff;

    border: 1px solid var(--ops-border);

    border-radius: var(--ops-radius-lg);

    padding: 22px;

    transition: all .18s ease;

}

.ops-step:hover {

    border-color: var(--ops-blue);

    box-shadow: 0 8px 22px rgba(0,0,0,.05);

}

.ops-step-accent {

    border-top: 4px solid var(--ops-blue);

}

.ops-step-number {

    width: 34px;

    height: 34px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background: var(--ops-blue-soft);

    color: var(--ops-blue);

    font-weight: 700;

    font-size: 15px;

    margin-bottom: 14px;

}

.ops-step-title {

    margin: 0 0 6px 0;

    font-size: 16px;

    font-weight: 700;

    color: var(--ops-text);

}

.ops-step-description {

    margin: 0;

    color: var(--ops-muted);

    font-size: 13px;

    line-height: 1.5;

}

@media (max-width: 900px) {

    .ops-stepper {

        grid-template-columns: 1fr;

    }

}