:root {
    --primary: #0F172A; 
    --primary-hover: #334155;
    --secondary: #4F46E5; 
    --secondary-hover: #4338CA;
    --bg-main: #F8FAFC; 
    --bg-panel: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --sidebar-w: 260px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.05);
    --radius-md: 10px;
    --radius-lg: 16px;
}
[data-theme="dark"] {
    --primary: #F8FAFC;
    --primary-hover: #E2E8F0;
    --secondary: #6366F1;
    --secondary-hover: #818CF8;
    --bg-main: #0B0F19; 
    --bg-panel: #111827;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #1E293B;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
html, body {
    overflow-x: hidden;
    width: 100%;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.5;
    position: relative;
}
.app-container {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}
.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 0 0.75rem;
    letter-spacing: -0.02em;
}
.logo i {
    color: var(--secondary);
}
.nav-links {
    list-style: none;
    flex: 1;
}
.nav-links li {
    margin-bottom: 0.25rem;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.nav-links a:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
}
.nav-links a.active {
    background-color: var(--primary);
    color: var(--bg-panel);
}
[data-theme="dark"] .nav-links a.active {
    color: var(--bg-panel); 
}
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    margin-top: auto;
    font-weight: 500;
    font-size: 0.95rem;
}
.theme-toggle:hover {
    background-color: var(--bg-main);
    color: var(--text-main);
}
.main-content {
    flex: 1;
    min-width: 0; 
    margin-left: var(--sidebar-w);
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: none;
}
.top-header {
    display: flex;
    width: 100%;
    overflow: hidden;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.top-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary {
    background-color: var(--primary);
    color: var(--bg-panel);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background-color: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover {
    background-color: var(--bg-main);
}
.content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.glass-panel {
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
.controls-panel {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
}
.controls-panel h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.control-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.control-group input, .control-group select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-panel);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem; 
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.control-group input:focus, .control-group select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.table-container {
    flex: 3;
    min-width: 0; 
    overflow: hidden;
    padding: 2rem;
}
.table-title-display {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}
.table-scroll {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    display: block;
    padding-bottom: 10px; 
}
.table-scroll::-webkit-scrollbar {
    height: 12px;
    background: var(--bg-panel);
}
.table-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 6px;
    border: 2px solid var(--bg-panel);
}
.table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    max-width: none;
}
th, td {
    border: 1px solid var(--border);
    padding: 0;
    text-align: center;
    position: relative;
}
th {
    background-color: var(--bg-main);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
td {
    height: 100px; 
    min-width: 130px;
    background-color: var(--bg-panel);
}
th:first-child, td:first-child {
    position: sticky;
    left: 0;
    z-index: 50;
    background-color: var(--bg-main);
    font-weight: 600;
    color: var(--text-main);
    box-shadow: 1px 0 0 var(--border);
}
td:first-child {
    padding: 0 1rem; 
    display: table-cell;
    vertical-align: middle;
}
.cell-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    text-align: center;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    padding: 0.75rem;
    display: block;
    line-height: 1.4;
    transition: background-color 0.2s;
}
.cell-input:focus {
    outline: none;
    background-color: rgba(79, 70, 229, 0.03);
}
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.75rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0.75rem);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
}
[data-theme="dark"] .bottom-nav {
    background-color: rgba(17, 24, 39, 0.9);
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 0.35rem;
    transition: color 0.2s;
    flex: 1;
}
.bottom-nav a i {
    font-size: 1.25rem;
}
.bottom-nav a.active {
    color: var(--secondary);
}
.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    width: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    padding-top: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
}
.header-actions::-webkit-scrollbar {
    display: none; 
}
.header-actions .btn, .header-actions label.btn {
    flex: 0 0 auto;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 72px !important;
    height: 72px !important;
    padding: 0.5rem !important;
    border-radius: 14px !important;
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
}
.header-actions .btn i, .header-actions label.btn i {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    color: var(--text-main) !important;
    transition: all 0.2s ease !important;
}
.header-actions .btn:hover, .header-actions label.btn:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: rgba(79, 70, 229, 0.05) !important; 
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.header-actions .btn:hover i, .header-actions label.btn:hover i {
    color: var(--primary) !important;
}
.header-actions label.btn input[type="file"] {
    display: none !important;
}
.mobile-header-brand {
    display: none;
    width: 100%;
    text-align: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}
.mobile-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column-reverse;
    }
    .controls-panel {
        max-width: 100%;
        width: 100%;
        position: static;
    }
}
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 1rem 0.5rem;
        padding-bottom: 7rem; 
    }
    .content-wrapper {
        padding: 0;
        margin: 0;
        width: 100%;
    }
    .controls-panel {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    .bottom-nav {
        display: flex;
    }
    .top-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        width: 100%;
    }
        .mobile-header-brand {
        display: flex;
    }
    .top-header h1 {
        display: none !important;
    }
    .top-header h1 {
        font-size: 1.25rem;
        width: 100%;
        text-align: center;
        margin: 0;
        line-height: 1.2;
    }
    .table-container {
        padding: 1rem;
    width: 100%; max-width: 100%; overflow-x: hidden;}
    td {
        height: 85px;
        min-width: 120px;
        padding: 8px; 
    }
    .cell-input {
        font-size: 1rem; 
    }
}
.panel-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}
.saved-tables-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    max-height: 250px;
    overflow-y: auto;
}
.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}
.saved-item:hover {
    border-color: var(--secondary);
}
.saved-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}
.saved-info strong {
    font-size: 0.875rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.saved-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.saved-actions {
    display: flex;
    gap: 0.5rem;
}
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s;
}
.btn-icon.load-btn:hover {
    color: var(--secondary);
}
.btn-icon.delete-btn:hover {
    color: #ef4444; 
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    width: 90%;
    max-width: 400px;
    background-color: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}
.color-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.color-item:last-child {
    border-bottom: none;
}
.time-input {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg-panel);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}
.time-input:focus {
    outline: none;
    border-color: var(--secondary);
}
.app-bg-layer {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}
.glass-panel {
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .glass-panel {
    background-color: rgba(17, 24, 39, 0.88);
}
.preset-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: transform 0.2s, border-color 0.2s;
}
.preset-btn:hover {
    border-color: var(--secondary);
    transform: scale(1.05);
}
.theme-classic th, .theme-classic td {
    border: 1px solid var(--border);
}
.theme-classic th {
    background-color: var(--bg-main);
}
.theme-classic td {
    background-color: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .theme-classic td {
    background-color: rgba(17, 24, 39, 0.7);
}
.theme-minimal table {
    border-collapse: collapse;
}
.theme-minimal th, .theme-minimal td {
    border: none;
    border-bottom: 1px solid var(--border);
}
.theme-minimal th {
    background-color: transparent;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
}
.theme-minimal td {
    background-color: transparent;
}
.theme-minimal .cell-input {
    font-weight: 500;
}
.theme-playful {
    border-spacing: 5px;
    border-collapse: separate;
}
.theme-playful th, .theme-playful td {
    border: none;
    border-radius: 12px;
}
.theme-playful th {
    background-color: #fca5a5;
    color: white;
    font-weight: 700;
    text-transform: capitalize;
}
.theme-playful td {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
[data-theme="dark"] .theme-playful td {
    background-color: rgba(31, 41, 55, 0.8);
}
.theme-playful .time-input {
    background: transparent;
    color: white;
    border-color: rgba(255,255,255,0.5);
}
.theme-playful .time-input::placeholder {
    color: rgba(255,255,255,0.8);
}
.theme-modern table {
    border-collapse: collapse;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}
.theme-modern th, .theme-modern td {
    border: none;
}
.theme-modern th {
    background-color: #0F172A;
    color: #F8FAFC;
    letter-spacing: 1px;
}
.theme-modern tr:nth-child(even) td {
    background-color: rgba(241, 245, 249, 0.8);
}
.theme-modern tr:nth-child(odd) td {
    background-color: rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .theme-modern tr:nth-child(even) td {
    background-color: rgba(30, 41, 59, 0.8);
}
[data-theme="dark"] .theme-modern tr:nth-child(odd) td {
    background-color: rgba(15, 23, 42, 0.8);
}
.theme-modern td {
    border-bottom: 1px solid var(--border);
}
.app-bg-layer {
    display: none;
}
.cell-icon-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border-radius: 4px;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.2s, background 0.2s;
}
.cell-icon-preview:hover {
    background: rgba(0,0,0,0.05);
    transform: scale(1.1);
}
[data-theme="dark"] .cell-icon-preview:hover {
    background: rgba(255,255,255,0.1);
}
.cell-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 2px;
}
.preset-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-main);
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.preset-icon-btn:hover {
    border-color: var(--secondary);
    transform: scale(1.1);
}
.seo-article {
    margin-top: 4rem;
    padding: 3rem;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
    color: var(--text-main);
}
.seo-article h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.seo-article h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 700;
}
.seo-article p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.seo-article p strong {
    color: var(--text-main);
}
.seo-article ul, .seo-article ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}
.seo-article li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.seo-article li strong {
    color: var(--primary);
}
.seo-article .article-hero-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    max-height: 400px;
}
@media (max-width: 768px) {
    .seo-article {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    .seo-article h2 {
        font-size: 1.5rem;
    }
    .seo-article h3 {
        font-size: 1.25rem;
    }
    .seo-article p, .seo-article li {
        font-size: 1rem;
    }
}
.site-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    margin-right: 0.5rem;
}
.site-footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 3rem 1rem 6rem; 
    margin-top: 3rem;
    color: var(--text-muted);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}
.footer-brand p {
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.5;
}
.footer-logo {
    height: 40px;
    width: auto;
}
.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}
.footer-column h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}
.footer-column a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-column a:hover {
    color: var(--primary);
}
.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    .footer-links {
        grid-template-columns: 1fr 1fr;
    }
    .site-footer {
        padding-bottom: 8rem; 
    }
}
@media (max-width: 480px) {
    .footer-links {
        grid-template-columns: 1fr;
    }
}
@media print {
    @page { size: landscape; margin: 10mm; }
    .sidebar, .controls-panel, .top-header, .seo-article, .site-footer, .bottom-nav, .saved-timetables-section {
        display: none !important;
    }
    body, html { margin: 0; padding: 0; background: white; }
    .main-content { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    .content-wrapper { display: block !important; }
    .table-container { padding: 0 !important; box-shadow: none !important; border: none !important; background: white !important; overflow: visible !important; }
    .table-scroll { overflow: visible !important; border: none !important; }
    .cell-input, .time-input { border: none !important; background: transparent !important; color: black !important; }
    .cell-icon-preview { display: none !important; }
    .cell-icon-preview[data-saved-icon] { display: flex !important; }
}
body.exporting .sidebar, 
body.exporting .controls-panel, 
body.exporting .top-header, 
body.exporting .seo-article, 
body.exporting .site-footer, 
body.exporting .saved-timetables-section,
body.exporting .bottom-nav {
    display: none !important;
}
body.exporting .main-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}
body.exporting .table-container {
    box-shadow: none !important;
    border: none !important;
}
body.exporting .table-scroll {
    overflow: visible !important;
}
body.exporting .cell-icon-preview {
    display: none !important;
}
body.exporting .cell-icon-preview[data-saved-icon] {
    display: flex !important;
}
body.exporting .cell-input, body.exporting .time-input {
    border: none !important;
    background: transparent !important;
}
@media print {
    td { height: 65px !important; }
    th { padding: 4px !important; }
    .table-title-display { margin-bottom: 5px !important; font-size: 1.2rem !important; }
}
body.exporting td { height: 65px !important; }
body.exporting th { padding: 4px !important; }
body.exporting .table-title-display { margin-bottom: 5px !important; font-size: 1.2rem !important; }
.saved-table-item {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-panel);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.saved-table-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.saved-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
@media (max-width: 900px) {
    .header-actions {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .header-actions .btn, .header-actions label.btn {
        flex: 0 0 auto !important; 
    }
}
