/**
 * Haupt-CSS für die CES-Anwendung
 * ALLE STYLES IN EINER DATEI
 */

/* =====================================================
   RESET & BASIS
   ===================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    line-height: 1.5;
}

.min-h-screen {
    min-height: 100vh;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.app-header {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px;
    min-height: calc(100vh - 200px);
}

.app-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    color: #6b7280;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.page-header p {
    font-size: 14px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* =====================================================
   NAVIGATION
   ===================================================== */
.app-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 10px;
    padding: 6px 12px 6px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    margin-right: 20px;
}

.app-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 8px;
    color: #ffffff;
}

.app-brand-icon svg {
    width: 20px;
    height: 20px;
    stroke: #ffffff;
}

.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.app-brand-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.app-brand-subtitle {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main-navigation {
    flex: 1;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.main-navigation li {
    display: block;
    position: relative;
}

.main-navigation a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.main-navigation a:hover {
    background: #374151;
    color: #ffffff;
}

.main-navigation a.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.main-navigation a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.main-navigation .dropdown-arrow {
    transition: transform 0.2s ease;
}

.main-navigation li.has-submenu:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* =====================================================
   SUBMENU
   ===================================================== */
.main-navigation .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #1f2937;
    border-radius: 8px;
    padding: 6px 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border: 1px solid #374151;
    z-index: 1000;
    margin-top: 4px;
}

/* Hover für Desktop */
@media (min-width: 901px) {
    .main-navigation li.has-submenu:hover .submenu {
        display: block !important;
    }
}

.main-navigation .submenu li {
    display: block;
}

.main-navigation .submenu a {
    padding: 8px 16px;
    color: #d1d5db;
    font-size: 13px;
    border-radius: 0;
    gap: 10px;
}

.main-navigation .submenu a:hover {
    background: #374151;
    color: #ffffff;
}

.main-navigation .submenu a svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.main-navigation .submenu a:hover svg {
    color: #d1d5db;
}

/* =====================================================
   HEADER USER
   ===================================================== */
.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50%;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 500;
}

.user-email {
    color: #9ca3af;
    font-size: 11px;
}

.logout-form {
    margin: 0;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.logout-button:hover {
    background: #374151;
    color: #ef4444;
}

.logout-button svg {
    width: 18px;
    height: 18px;
}

/* =====================================================
   FORMULARE
   ===================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #ffffff;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.form-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.form-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-grid-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-gray {
    background: #6b7280;
    color: #ffffff;
}

.btn-gray:hover {
    background: #4b5563;
}

.btn-outline {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-xs {
    padding: 0.125rem 0.5rem;
    font-size: 0.675rem;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* =====================================================
   CARDS & TABELLEN
   ===================================================== */
.card {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.table tr:hover td {
    background: #f9fafb;
}

.table tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    gap: 0.25rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: #f3f4f6;
    color: #6b7280;
}

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border-left: 4px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-icon svg {
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-content p {
    margin: 0;
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s ease;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .active span {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.pagination .disabled span {
    color: #9ca3af;
    cursor: not-allowed;
}

/* =====================================================
   CES-SPEZIFISCH
   ===================================================== */
.ces-detail-section {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ces-detail-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ces-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
}

.ces-detail-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
}

.ces-detail-item strong {
    min-width: 160px;
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
}

.ces-detail-item .value {
    color: #1f2937;
    flex: 1;
}

.ces-form-section {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ces-form-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.ces-subform {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
}

.ces-subform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ces-subform-title {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ces-subform-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.ces-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ces-stat-card {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    border-left: 4px solid #2563eb;
}

.ces-stat-card h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
}

.ces-stat-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.ces-stat-card .sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.ces-stat-card.blue { border-color: #2563eb; }
.ces-stat-card.green { border-color: #16a34a; }
.ces-stat-card.yellow { border-color: #f59e0b; }
.ces-stat-card.purple { border-color: #7c3aed; }

.ces-filter {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.ces-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.ces-filter-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 180px;
}

.ces-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ces-table-mini {
    font-size: 0.875rem;
    width: 100%;
    border-collapse: collapse;
}

.ces-table-mini th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.ces-table-mini td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.ces-table-mini tr:last-child td {
    border-bottom: none;
}

/* =====================================================
   DASHBOARD
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dashboard-card h2 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0.25rem 0 0.5rem 0;
}

.dashboard-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.dashboard-card .trend {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.dashboard-card .trend.up {
    background: #dcfce7;
    color: #16a34a;
}

.dashboard-card .trend.down {
    background: #fee2e2;
    color: #dc2626;
}

.dashboard-card-status {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.dashboard-recent {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-recent-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-recent-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.dashboard-recent-item {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease;
}

.dashboard-recent-item:hover {
    background: #f9fafb;
}

.dashboard-recent-item:last-child {
    border-bottom: none;
}

.dashboard-recent-item .info {
    flex: 1;
}

.dashboard-recent-item .info .title {
    font-weight: 500;
    color: #1f2937;
}

.dashboard-recent-item .info .sub {
    font-size: 0.75rem;
    color: #6b7280;
}

.dashboard-recent-item .status {
    flex-shrink: 0;
    margin-left: 1rem;
}

.dashboard-recent-footer {
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.dashboard-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    text-align: center;
}

.dashboard-quick-action:hover {
    transform: translateY(-2px);
}

.dashboard-quick-action .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dashboard-quick-action .label {
    font-size: 0.75rem;
    font-weight: 500;
}

.dashboard-quick-action.primary {
    background: #eff6ff;
    color: #1e40af;
}

.dashboard-quick-action.primary:hover {
    background: #dbeafe;
}

.dashboard-quick-action.gray {
    background: #f3f4f6;
    color: #374151;
}

.dashboard-quick-action.gray:hover {
    background: #e5e7eb;
}

/* =====================================================
   SUB-NAVIGATION (TABS)
   ===================================================== */
.ces-sub-nav-tabs {
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.ces-sub-nav-tabs a {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #6b7280;
    display: inline-block;
}

.ces-sub-nav-tabs a:hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

.ces-sub-nav-tabs a.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: #6b7280; }
.text-gray-400 { color: #9ca3af; }
.text-gray-700 { color: #374151; }
.text-blue-600 { color: #2563eb; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* =====================================================
   GRID HELPERS
   ===================================================== */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* =====================================================
   MOBILE
   ===================================================== */
@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 10px;
    }
    
    .app-content {
        padding: 16px 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .page-header-actions {
        flex-wrap: wrap;
    }
    
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .ces-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .ces-detail-item {
        flex-direction: column;
    }
    
    .ces-detail-item strong {
        min-width: auto;
    }
    
    .ces-subform-grid {
        grid-template-columns: 1fr;
    }
    
    .ces-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .dashboard-recent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dashboard-recent-item .status {
        margin-left: 0;
    }
    
    .user-details {
        display: none;
    }
    
    .app-brand {
        border-right: none;
        margin-right: 0;
        padding: 0 0 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
    }
    
    .app-brand-subtitle {
        display: inline;
        margin-left: 8px;
    }
    
    .main-navigation {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-navigation ul {
        width: max-content;
        min-width: 100%;
    }
    
    .main-navigation a {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .main-navigation .submenu {
        position: static;
        background: transparent;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        margin-top: 0;
        border-radius: 0;
        display: block !important;
    }
    
    .main-navigation .submenu a {
        padding: 6px 12px;
        font-size: 12px;
        color: #9ca3af;
    }
    
    .main-navigation .submenu a svg {
        width: 14px;
        height: 14px;
    }
    
    .main-navigation .dropdown-arrow {
        display: none;
    }
    
    .header-user {
        width: 100%;
        border-left: none;
        padding-left: 0;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .logout-button span {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 10px 12px;
    }
    
    .app-brand-title {
        font-size: 16px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .main-navigation a {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .main-navigation a svg {
        width: 14px;
        height: 14px;
    }
    
    .ces-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.main-navigation svg,
.btn svg,
.page-header-actions svg,
.app-header svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.card-body svg {
    width: 64px;
    height: 64px;
}