/* =========================================================
   LogIt
   M4 Medical Services
   Core Application Styles
   ========================================================= */

:root {
    --logit-primary: #1f2937;
    --logit-primary-dark: #111827;
    --logit-accent: #6fae3f;
    --logit-accent-dark: #5d9634;

    --logit-background: #f3f4f6;
    --logit-surface: #ffffff;

    --logit-text: #1f2937;
    --logit-text-muted: #6b7280;

    --logit-border: #e5e7eb;

    --logit-success: #15803d;
    --logit-success-bg: #dcfce7;

    --logit-warning: #b45309;
    --logit-warning-bg: #fef3c7;

    --logit-danger: #b91c1c;
    --logit-danger-bg: #fee2e2;

    --logit-info: #0369a1;
    --logit-info-bg: #e0f2fe;

    --logit-radius: 10px;
    --logit-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

    --logit-sidebar-width: 230px;
}

/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--logit-background);
    color: var(--logit-text);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================================
   Application Shell
   ========================================================= */

.logit-app {
    min-height: 100vh;
}

/* =========================================================
   Top Bar
   ========================================================= */

.logit-topbar {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    background: var(--logit-primary);
    color: #ffffff;
}

/* Main application logo */

.logit-brand {
    display: flex;
    align-items: center;
    gap: 14px;

    height: 100%;
}

.logit-brand-logo {
    display: block;

    width: 150px;
    max-width: 150px;
    height: auto;
    max-height: 48px;

    object-fit: contain;
    object-position: left center;
}

.logit-brand-divider {
    width: 1px;
    height: 32px;

    background: rgba(255, 255, 255, 0.25);
}

.logit-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* User area */

.logit-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logit-user-name {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

.logit-user-role {
    margin-top: 1px;

    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);

    text-align: right;
}

.logit-logout {
    display: inline-flex;
    align-items: center;

    min-height: 36px;
    padding: 0 13px;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 7px;

    color: #ffffff;

    font-size: 13px;
    font-weight: 600;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.logit-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
}

/* =========================================================
   Main Layout
   ========================================================= */

.logit-layout {
    display: flex;
    min-height: calc(100vh - 72px);
}

/* =========================================================
   Sidebar
   ========================================================= */

.logit-sidebar {
    width: var(--logit-sidebar-width);
    flex: 0 0 var(--logit-sidebar-width);

    background: var(--logit-primary-dark);
    color: #ffffff;

    padding: 24px 14px;
}

.logit-sidebar-section {
    margin-bottom: 28px;
}

.logit-sidebar-label {
    padding: 0 12px 8px;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;

    color: rgba(255, 255, 255, 0.4);
}

.logit-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.logit-nav a {
    display: flex;
    align-items: center;

    min-height: 42px;
    padding: 0 12px;

    border-radius: 7px;

    color: rgba(255, 255, 255, 0.78);

    font-size: 14px;
    font-weight: 500;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.logit-nav a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.logit-nav a.active {
    background: var(--logit-accent);
    color: #ffffff;
}

/* =========================================================
   Main Content
   ========================================================= */

.logit-main {
    flex: 1;
    min-width: 0;

    padding: 30px;
}

/* =========================================================
   Page Header
   ========================================================= */

.logit-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}

.logit-page-header h1 {
    margin: 0;

    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
}

.logit-page-header p {
    margin: 6px 0 0;

    color: var(--logit-text-muted);
    font-size: 14px;
}

/* =========================================================
   Cards
   ========================================================= */

.logit-card {
    background: var(--logit-surface);

    border: 1px solid var(--logit-border);
    border-radius: var(--logit-radius);

    box-shadow: var(--logit-shadow);
}

.logit-card-header {
    padding: 18px 20px;

    border-bottom: 1px solid var(--logit-border);
}

.logit-card-header h2,
.logit-card-header h3 {
    margin: 0;

    font-size: 16px;
    font-weight: 700;
}

.logit-card-body {
    padding: 20px;
}

.logit-card-footer {
    padding: 14px 20px;

    border-top: 1px solid var(--logit-border);

    background: #fafafa;
}

/* =========================================================
   Grid
   ========================================================= */

.logit-grid {
    display: grid;
    gap: 20px;
}

.logit-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logit-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.logit-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* =========================================================
   Forms
   ========================================================= */

.logit-form-group {
    margin-bottom: 18px;
}

.logit-form-group:last-child {
    margin-bottom: 0;
}

.logit-form-label {
    display: block;

    margin-bottom: 6px;

    font-size: 13px;
    font-weight: 650;
}

.logit-form-help {
    margin-top: 5px;

    color: var(--logit-text-muted);
    font-size: 12px;
}

.logit-input,
.logit-select,
.logit-textarea {
    width: 100%;

    padding: 10px 12px;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    background: #ffffff;
    color: var(--logit-text);

    font-size: 14px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.logit-input:focus,
.logit-select:focus,
.logit-textarea:focus {
    border-color: var(--logit-accent);

    box-shadow:
        0 0 0 3px rgba(111, 174, 63, 0.15);
}

.logit-textarea {
    min-height: 110px;
    resize: vertical;
}

/* =========================================================
   Buttons
   ========================================================= */

.logit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.logit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    padding: 0 15px;

    border: 1px solid transparent;
    border-radius: 7px;

    cursor: pointer;

    font-size: 13px;
    font-weight: 650;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.05s ease;
}

.logit-btn:active {
    transform: translateY(1px);
}

.logit-btn-primary {
    background: var(--logit-accent);
    color: #ffffff;
}

.logit-btn-primary:hover {
    background: var(--logit-accent-dark);
}

.logit-btn-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: var(--logit-text);
}

.logit-btn-secondary:hover {
    background: #f9fafb;
}

.logit-btn-danger {
    background: var(--logit-danger);
    color: #ffffff;
}

.logit-btn-danger:hover {
    background: #991b1b;
}

.logit-btn-warning {
    background: #d97706;
    color: #ffffff;
}

.logit-btn-warning:hover {
    background: #b45309;
}

.logit-btn-small {
    min-height: 34px;
    padding: 0 11px;

    font-size: 12px;
}

/* =========================================================
   Status Badges
   ========================================================= */

.logit-status {
    display: inline-flex;
    align-items: center;

    min-height: 26px;
    padding: 0 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.03em;
}

.logit-status-scheduled {
    background: var(--logit-warning-bg);
    color: var(--logit-warning);
}

.logit-status-open {
    background: var(--logit-success-bg);
    color: var(--logit-success);
}

.logit-status-closed {
    background: #e5e7eb;
    color: #4b5563;
}

/* =========================================================
   Shift Summary
   ========================================================= */

.logit-shift-summary {
    display: grid;

    grid-template-columns: repeat(4, minmax(0, 1fr));

    border: 1px solid var(--logit-border);
    border-radius: var(--logit-radius);

    overflow: hidden;

    background: #ffffff;

    box-shadow: var(--logit-shadow);
}

.logit-shift-summary-item {
    padding: 16px 18px;

    border-right: 1px solid var(--logit-border);
}

.logit-shift-summary-item:last-child {
    border-right: 0;
}

.logit-shift-summary-label {
    margin-bottom: 4px;

    color: var(--logit-text-muted);

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logit-shift-summary-value {
    font-size: 14px;
    font-weight: 600;
}

/* =========================================================
   Log Timeline
   ========================================================= */

.logit-timeline {
    display: flex;
    flex-direction: column;
}

.logit-log-entry {
    position: relative;

    padding: 18px 0 18px 20px;

    border-bottom: 1px solid var(--logit-border);
}

.logit-log-entry:last-child {
    border-bottom: 0;
}

.logit-log-entry::before {
    content: "";

    position: absolute;
    top: 25px;
    left: 0;

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--logit-accent);
}

.logit-log-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 8px;
}

.logit-log-entry-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;
}

.logit-log-entry-time {
    color: var(--logit-text-muted);

    font-size: 12px;
}

.logit-log-entry-text {
    white-space: pre-wrap;

    font-size: 14px;
}

.logit-log-entry-footer {
    display: flex;
    align-items: center;
    gap: 8px;

    margin-top: 10px;

    color: var(--logit-text-muted);

    font-size: 12px;
}

/* =========================================================
   Alerts
   ========================================================= */

.logit-alert {
    margin-bottom: 20px;
    padding: 12px 14px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 13px;
}

.logit-alert-success {
    background: var(--logit-success-bg);
    border-color: #bbf7d0;
    color: var(--logit-success);
}

.logit-alert-warning {
    background: var(--logit-warning-bg);
    border-color: #fde68a;
    color: var(--logit-warning);
}

.logit-alert-danger {
    background: var(--logit-danger-bg);
    border-color: #fecaca;
    color: var(--logit-danger);
}

.logit-alert-info {
    background: var(--logit-info-bg);
    border-color: #bae6fd;
    color: var(--logit-info);
}

/* =========================================================
   Tables
   ========================================================= */

.logit-table-wrapper {
    overflow-x: auto;
}

.logit-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;
}

.logit-table th {
    padding: 11px 14px;

    background: #f9fafb;

    border-bottom: 1px solid var(--logit-border);

    color: var(--logit-text-muted);

    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.04em;

    text-align: left;
}

.logit-table td {
    padding: 13px 14px;

    border-bottom: 1px solid var(--logit-border);

    vertical-align: middle;
}

.logit-table tbody tr:hover {
    background: #fafafa;
}

/* =========================================================
   Empty States
   ========================================================= */

.logit-empty {
    padding: 45px 25px;

    text-align: center;

    color: var(--logit-text-muted);
}

.logit-empty-title {
    margin-bottom: 5px;

    color: var(--logit-text);

    font-size: 16px;
    font-weight: 700;
}

.logit-empty-text {
    font-size: 13px;
}

/* =========================================================
   Login
   ========================================================= */

.logit-login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        linear-gradient(
            135deg,
            #f3f4f6 0%,
            #e5e7eb 100%
        );
}

.logit-login-wrapper {
    width: 100%;
    max-width: 430px;
}

.logit-login-card {
    padding: 34px;

    background: #ffffff;

    border: 1px solid var(--logit-border);
    border-radius: 14px;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.09);
}

.logit-login-brand {
    display: flex;
    justify-content: center;

    margin-bottom: 28px;
}

.logit-login-logo {
    display: block;

    width: 250px;
    max-width: 80%;

    height: auto;
}

.logit-login-title {
    margin: 0;

    text-align: center;

    font-size: 24px;
    font-weight: 750;
}

.logit-login-subtitle {
    margin: 7px 0 26px;

    text-align: center;

    color: var(--logit-text-muted);

    font-size: 13px;
}

.logit-login-footer {
    margin-top: 22px;

    text-align: center;

    color: var(--logit-text-muted);

    font-size: 11px;
}

/* =========================================================
   Utility
   ========================================================= */

.logit-muted {
    color: var(--logit-text-muted);
}

.logit-small {
    font-size: 12px;
}

.logit-mt-0 {
    margin-top: 0;
}

.logit-mt-1 {
    margin-top: 8px;
}

.logit-mt-2 {
    margin-top: 16px;
}

.logit-mt-3 {
    margin-top: 24px;
}

.logit-mb-0 {
    margin-bottom: 0;
}

.logit-mb-1 {
    margin-bottom: 8px;
}

.logit-mb-2 {
    margin-bottom: 16px;
}

.logit-mb-3 {
    margin-bottom: 24px;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {

    .logit-sidebar {
        width: 190px;
        flex-basis: 190px;
    }

    .logit-main {
        padding: 24px;
    }

    .logit-shift-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logit-shift-summary-item:nth-child(2) {
        border-right: 0;
    }

    .logit-shift-summary-item:nth-child(-n + 2) {
        border-bottom: 1px solid var(--logit-border);
    }

    .logit-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .logit-topbar {
        height: auto;
        min-height: 68px;

        padding: 12px 16px;
    }

    .logit-brand-logo {
        width: 125px;
        max-width: 125px;
    }

    .logit-brand-divider,
    .logit-brand-name {
        display: none;
    }

    .logit-user-role {
        display: none;
    }

    .logit-user {
        gap: 10px;
    }

    .logit-user-name {
        display: none;
    }

    .logit-layout {
        display: block;
    }

    .logit-sidebar {
        width: 100%;

        padding: 8px 12px;
    }

    .logit-sidebar-section {
        margin-bottom: 8px;
    }

    .logit-sidebar-label {
        display: none;
    }

    .logit-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .logit-nav a {
        min-height: 36px;
    }

    .logit-main {
        padding: 20px 16px;
    }

    .logit-page-header {
        display: block;
    }

    .logit-page-header .logit-actions {
        margin-top: 15px;
    }

    .logit-grid-2,
    .logit-grid-3,
    .logit-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {

    .logit-login-page {
        padding: 16px;
    }

    .logit-login-card {
        padding: 25px 20px;
    }

    .logit-login-logo {
        width: 220px;
    }

    .logit-shift-summary {
        grid-template-columns: 1fr;
    }

    .logit-shift-summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--logit-border);
    }

    .logit-shift-summary-item:last-child {
        border-bottom: 0;
    }
}