/* ============================================================
   TimeKeeper action-button utilities
   Lightweight, borderless button styles for table and
   command-bar actions. Leaves btn-primary intact for the
   single primary CTA per screen and modal submit buttons.
   ============================================================

   Usage with Orchid PHP actions:
     ->class('btn btn-action btn-sm icon-link gap-2')
     ->class('btn btn-action-success btn-sm icon-link gap-2')
     ->class('btn btn-action-danger btn-sm icon-link gap-2')

   Usage in Blade templates:
     class="btn btn-action btn-sm icon-link gap-2"
     class="btn btn-action-success btn-sm icon-link gap-2"
     class="btn btn-action-danger btn-sm icon-link gap-2"
   ============================================================ */

/* Base: neutral, transparent background, no border */
.btn-action {
    --bs-btn-color: #495057;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #212529;
    --bs-btn-hover-bg: rgba(0, 0, 0, 0.08);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #212529;
    --bs-btn-active-bg: rgba(0, 0, 0, 0.12);
    --bs-btn-active-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 108, 117, 125;
}

/* Positive / success-tinted: Approve, Activate, Restore, Mark Active */
.btn-action-success {
    --bs-btn-color: #198754;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #146c43;
    --bs-btn-hover-bg: rgba(25, 135, 84, 0.08);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #146c43;
    --bs-btn-active-bg: rgba(25, 135, 84, 0.15);
    --bs-btn-active-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 25, 135, 84;
}

/* ============================================================
   Dashboard Quick Action tiles
   Each tile uses a pale tinted surface with matching text/icon
   color. Log Time (primary) sits at a slightly stronger tint.
   All share the same structure; only the hue differs.
   ============================================================ */

.qa-tile {
    display: block;
    width: 100%;
    padding: 1.25rem 0.75rem;
    text-align: center;
    text-decoration: none;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    line-height: 1.4;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.qa-tile:hover { text-decoration: none; }

/* Log Time — blue, slightly stronger tint for prominence */
.qa-tile-primary {
    background-color: rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.30);
    color: #0d6efd;
    font-weight: 500;
}
.qa-tile-primary:hover {
    background-color: rgba(13, 110, 253, 0.20);
    border-color: rgba(13, 110, 253, 0.45);
    color: #0a58ca;
}

/* Review Tasks — amber */
.qa-tile-amber {
    background-color: rgba(255, 193, 7, 0.10);
    border-color: rgba(255, 193, 7, 0.35);
    color: #856404;
}
.qa-tile-amber:hover {
    background-color: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.55);
    color: #664e02;
}

/* Reports — teal */
.qa-tile-teal {
    background-color: rgba(13, 202, 240, 0.10);
    border-color: rgba(13, 202, 240, 0.30);
    color: #055160;
}
.qa-tile-teal:hover {
    background-color: rgba(13, 202, 240, 0.18);
    border-color: rgba(13, 202, 240, 0.50);
    color: #033d4a;
}

/* Invoicing — green */
.qa-tile-green {
    background-color: rgba(25, 135, 84, 0.10);
    border-color: rgba(25, 135, 84, 0.28);
    color: #198754;
}
.qa-tile-green:hover {
    background-color: rgba(25, 135, 84, 0.17);
    border-color: rgba(25, 135, 84, 0.45);
    color: #146c43;
}

/* Payroll — slate */
.qa-tile-slate {
    background-color: rgba(108, 117, 125, 0.10);
    border-color: rgba(108, 117, 125, 0.28);
    color: #495057;
}
.qa-tile-slate:hover {
    background-color: rgba(108, 117, 125, 0.17);
    border-color: rgba(108, 117, 125, 0.45);
    color: #212529;
}

.qa-tile-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}
.qa-tile-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Destructive / danger-tinted: Delete, Revoke, Archive */
.btn-action-danger {
    --bs-btn-color: #dc3545;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #b02a37;
    --bs-btn-hover-bg: rgba(220, 53, 69, 0.08);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #b02a37;
    --bs-btn-active-bg: rgba(220, 53, 69, 0.15);
    --bs-btn-active-border-color: transparent;
    --bs-btn-focus-shadow-rgb: 220, 53, 69;
}

/* ============================================================
   Collapsible sidebar (desktop only)
   The collapsed state lives on <html> (class tk-aside-hidden)
   because Orchid navigates with Turbo, which swaps <body> on
   every visit. State persists via localStorage in
   public/js/timekeeper.js, which also injects the toggle tab.
   Mobile (<992px) keeps Orchid's built-in hamburger collapse.
   ============================================================ */

@media (min-width: 992px) {
    .aside {
        transition: width 0.25s ease, min-width 0.25s ease;
    }

    html.tk-aside-hidden .aside {
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        white-space: nowrap; /* avoid text reflow during the slide */
    }

    /* Let the content column take the freed space */
    html.tk-aside-hidden .aside + div {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .tk-aside-toggle {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1040;
        width: 18px;
        height: 56px;
        border: 0;
        border-radius: 0 8px 8px 0;
        background: rgba(33, 37, 41, 0.55);
        color: #fff;
        font-size: 11px;
        line-height: 1;
        padding: 0;
        cursor: pointer;
        opacity: 0.45;
        transition: opacity 0.15s ease, left 0.25s ease, background 0.15s ease;
    }
    .tk-aside-toggle:hover {
        opacity: 1;
        background: rgba(33, 37, 41, 0.85);
    }
}

/* The toggle is desktop-only; Orchid's hamburger covers mobile */
@media (max-width: 991.98px) {
    .tk-aside-toggle { display: none; }
}

/* ============================================================
   Chrome removals (by request)
   - Hide breadcrumbs on every screen.
   - Sidebar brand (logo + title) is blanked in brand/header.blade.php;
     trim the now-empty header so the menu starts near the top.
   ============================================================ */
nav[aria-label="breadcrumb"] { display: none !important; }

@media (min-width: 992px) {
    .aside > header {
        margin-top: 0.75rem !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0 !important;
    }
}
