:root {
    --sidebar-width: 230px;
    --bg-main: #f5f6f8;
    --topbar-bg: #1f2937;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-active: #0d6efd;
}

body {
    margin: 0;
    background: var(--bg-main);
    font-size: 15px;
}

.app-topbar {
    height: 90px;
    background: var(--topbar-bg);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 4px solid #0d6efd;
}

.app-logo-box {
    width: 52px;
    height: 52px;
    background: #fff;
    border-radius: 8px;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-logo {
    max-width: 46px;
    max-height: 46px;
}

.app-topbar-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.app-topbar-subtitle {
    font-size: 14px;
    color: #dbeafe;
    margin-top: 4px;
}

.app-shell {
    min-height: calc(100vh - 90px);
    display: flex;
}

.app-sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - 90px);
    background: var(--sidebar-bg);
    color: #fff;
    padding: 18px 10px;
    flex-shrink: 0;
}

.app-sidebar a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 4px;
}

.app-sidebar a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.app-sidebar a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.app-main {
    flex: 1;
    padding: 28px;
}

.app-main {
    flex: 1;
    padding: 24px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 18px;
}

.card-dashboard {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.dashboard-number {
    font-size: 32px;
    font-weight: 700;
}

.table td,
.table th {
    vertical-align: middle;
}

.actions-cell {
    white-space: nowrap;
}

.form-label {
    font-weight: 600;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        width: 100%;
        min-height: auto;
    }

    .app-main {
        padding: 16px;
    }
}

.agenda-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(170px, 1fr));
    gap: 12px;
    overflow-x: auto;
}

.agenda-day {
    min-height: 520px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.agenda-day-today {
    border: 2px solid #0d6efd;
    background: #eef5ff;
}

.agenda-day-header {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    border-radius: 12px 12px 0 0;
}

.agenda-day-name {
    font-weight: 700;
    font-size: 15px;
}

.agenda-day-date {
    color: #6c757d;
    font-size: 13px;
}

.agenda-day-body {
    padding: 10px;
    flex: 1;
}

.agenda-empty {
    color: #999;
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}

.agenda-item {
    background: #fff;
    border-radius: 10px;
    padding: 9px;
    margin-bottom: 9px;
    border-left: 5px solid #0d6efd;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.agenda-item-app {
    border-left-color: #0d6efd;
}

.agenda-item-sca {
    border-left-color: #dc3545;
}

.agenda-item-time {
    font-size: 12px;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 2px;
}

.agenda-item-title {
    font-weight: 700;
    font-size: 14px;
}

.agenda-item-title a {
    color: #212529;
    text-decoration: none;
}

.agenda-item-title a:hover {
    text-decoration: underline;
}

.agenda-item-sub {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.agenda-item-actions {
    font-size: 12px;
    margin-top: 6px;
}

.agenda-item-actions a {
    text-decoration: none;
}

@media (max-width: 1200px) {
    .agenda-week-grid {
        grid-template-columns: repeat(7, 180px);
    }
}

.agenda-hour-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    min-height: 72px;
    border-bottom: 1px solid #e5e7eb;
}

.agenda-hour-row:last-child {
    border-bottom: 0;
}

.agenda-hour-row-no-time {
    background: #fff8e1;
}

.agenda-hour-label {
    background: #f8f9fa;
    border-right: 1px solid #e5e7eb;
    padding: 12px;
    font-weight: 700;
    color: #6c757d;
    text-align: right;
}

.agenda-hour-content {
    padding: 8px 12px;
}

.agenda-hour-empty {
    min-height: 44px;
}

.agenda-day-app-item {
    background: #fff;
    border-left: 5px solid #0d6efd;
    border-radius: 10px;
    padding: 9px 11px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.agenda-day-scadenza {
    background: #fff;
    border-left: 5px solid #dc3545;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.agenda-day-scadenza a {
    text-decoration: none;
}

.agenda-day-scadenza a:hover {
    text-decoration: underline;
}

@media (max-width: 800px) {
    .agenda-hour-row {
        grid-template-columns: 70px 1fr;
    }

    .agenda-hour-label {
        padding: 10px 6px;
        font-size: 13px;
    }
}