/*
Theme Name: IPP Owner Portal
Theme URI: https://owner.propertymanagementphuket.com
Description: Inter Property Phuket Owner Portal - Custom dashboard theme with left sidebar navigation
Author: Inter Property Phuket
Version: 1.0.0
License: Proprietary
Text Domain: ipp-owner-portal
*/

/* ============================================
   CSS VARIABLES - IPP Color Palette
   ============================================ */
:root {
    /* Primary Colors */
    --ipp-green: #A1CD4F;
    --ipp-green-hover: #8fb845;
    --ipp-dark: #393634;
    --ipp-slate: #747F9C;
    --ipp-light-gray: #E4E5E5;
    --ipp-soft-blue: #A2BBCF;
    --ipp-purple: #9088B8; /* Added for accent pattern */
    
    /* Extended Palette */
    --ipp-white: #FFFFFF;
    --ipp-black: #1a1918;
    --ipp-text: #393634;
    --ipp-text-light: #6b6966;
    --ipp-border: #d1d3d4;
    --ipp-success: #A1CD4F;
    --ipp-warning: #FFB347;
    --ipp-danger: #FF6B6B;
    --ipp-info: #A2BBCF;
    
    /* Layout */
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 85px;
    --header-height: 120px;
    --transition-speed: 0.3s;
    
    /* Typography */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--ipp-text);
    background-color: var(--ipp-light-gray);
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--ipp-slate);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--ipp-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--ipp-dark);
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   MAIN LAYOUT WRAPPER
   ============================================ */
#ipp-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================
   WORDPRESS ADMIN BAR FIX
   ============================================ */
body.admin-bar #ipp-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}

body.admin-bar #ipp-main {
    padding-top: 0;
}

@media screen and (max-width: 782px) {
    body.admin-bar #ipp-sidebar {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
#ipp-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--ipp-dark);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width var(--transition-speed) ease;
    overflow-y: auto;
    overflow-x: hidden;
}

#ipp-sidebar::-webkit-scrollbar {
    width: 5px;
}

#ipp-sidebar::-webkit-scrollbar-track {
    background: var(--ipp-dark);
}

#ipp-sidebar::-webkit-scrollbar-thumb {
    background: var(--ipp-slate);
    border-radius: 3px;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 20px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-logo img,
.sidebar-logo .custom-logo-link img {
    max-width: 55px;
    height: auto;
    background: var(--ipp-slate);
    padding: 10px;
    border-radius: 10px;
}

.sidebar-logo .logo-text {
    display: none;
}

/* Logo icon placeholder if no image */
.sidebar-logo .logo-icon {
    width: 55px;
    height: 55px;
    background: var(--ipp-slate);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--ipp-white);
    font-size: 1.8rem;
}

/* User Profile in Sidebar */
.sidebar-user {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user .user-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
    border: 3px solid var(--ipp-green);
}

.sidebar-user .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user .user-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--ipp-slate);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ipp-white);
    font-size: 1.5rem;
}

.sidebar-user .user-name {
    color: var(--ipp-white);
    font-size: 1rem;
    font-weight: 500;
}

.sidebar-user .user-role {
    color: var(--ipp-soft-blue);
    font-size: 0.8125rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-item {
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--ipp-slate);
    font-size: 0.9rem;
    font-weight: 400;
    transition: all var(--transition-speed);
    border-right: 5px solid var(--ipp-slate);
    background: transparent;
    text-decoration: none;
    gap: 12px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--ipp-white);
}

.sidebar-nav .nav-link .nav-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link .nav-icon i {
    font-size: 1.3rem;
    line-height: 1;
    color: inherit;
}

/* Ensure FA6 icons display */
.sidebar-nav .nav-link .nav-icon i.fa-solid,
.sidebar-nav .nav-link .nav-icon i.fa-regular,
.sidebar-nav .nav-link .nav-icon i.fa-brands,
.sidebar-nav .nav-link .nav-icon i.fas,
.sidebar-nav .nav-link .nav-icon i.far,
.sidebar-nav .nav-link .nav-icon i.fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome !important;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dashicons support */
.sidebar-nav .nav-link .nav-icon .dashicons {
    font-size: 1.3rem;
    width: auto;
    height: auto;
    line-height: 1;
}

/* SVG icon support */
.sidebar-nav .nav-link .nav-icon svg {
    width: 1.3rem;
    height: 1.3rem;
    fill: currentColor;
}

/* Show text labels */
.sidebar-nav .nav-text {
    display: block;
    white-space: nowrap;
    color: var(--ipp-light-gray);
    font-weight: 400;
}

.sidebar-nav .nav-link:hover .nav-text {
    color: var(--ipp-white);
}

.sidebar-nav .submenu-arrow {
    display: none;
}

/* Default - gray if no class specified */
.sidebar-nav .nav-item .nav-link {
    border-right-color: var(--ipp-slate);
}
.sidebar-nav .nav-item .nav-link .nav-icon {
    color: var(--ipp-slate);
}

/* Manual Color Classes - Add these in menu item CSS Classes field */
/* GREEN: ipp-green - green icon + green bar */
.sidebar-nav .nav-item.ipp-green .nav-link { 
    border-right-color: var(--ipp-green) !important; 
}
.sidebar-nav .nav-item.ipp-green .nav-link .nav-icon {
    color: var(--ipp-green) !important;
}

/* GRAY: ipp-gray - gray icon + gray bar */
.sidebar-nav .nav-item.ipp-gray .nav-link { 
    border-right-color: var(--ipp-light-gray) !important; 
}
.sidebar-nav .nav-item.ipp-gray .nav-link .nav-icon {
    color: var(--ipp-light-gray) !important;
}

/* BLUE: ipp-blue - blue icon + blue bar */
.sidebar-nav .nav-item.ipp-blue .nav-link { 
    border-right-color: var(--ipp-soft-blue) !important; 
}
.sidebar-nav .nav-item.ipp-blue .nav-link .nav-icon {
    color: var(--ipp-soft-blue) !important;
}

/* PURPLE: ipp-purple - purple icon + purple bar */
.sidebar-nav .nav-item.ipp-purple .nav-link { 
    border-right-color: var(--ipp-purple) !important; 
}
.sidebar-nav .nav-item.ipp-purple .nav-link .nav-icon {
    color: var(--ipp-purple) !important;
}

/* Tooltip - hidden when text is visible */
.sidebar-nav .nav-link::after {
    display: none;
}

.sidebar-nav .nav-text {
    white-space: nowrap;
    overflow: hidden;
}

/* Submenu - shows on hover as flyout */
.sidebar-nav .has-submenu .submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--ipp-dark);
    min-width: 200px;
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    padding: 10px 0;
    z-index: 1001;
}

.sidebar-nav .has-submenu {
    position: relative;
}

.sidebar-nav .has-submenu:hover .submenu {
    display: block;
}

.sidebar-nav .submenu .nav-item {
    border-bottom: none;
}

.sidebar-nav .submenu .nav-link {
    padding: 10px 20px;
    justify-content: flex-start;
    border-right: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
}

.sidebar-nav .submenu .nav-link:hover {
    color: var(--ipp-green);
}

.sidebar-nav .submenu .nav-text {
    display: block;
    margin-left: 10px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
#ipp-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-speed);
    background: var(--ipp-white);
}

/* Top Header Bar */
#ipp-header {
    min-height: 120px;
    background: var(--ipp-white);
    border-bottom: 3px solid var(--ipp-soft-blue);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-branding {
    display: flex;
    flex-direction: column;
}

.header-branding .brand-line-1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--ipp-green);
    letter-spacing: 1px;
}

.header-branding .brand-line-2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.1;
}

.header-branding .brand-line-2 .green {
    color: var(--ipp-green);
}

.header-branding .brand-line-2 .gray {
    color: var(--ipp-slate);
}

.header-branding .brand-tagline {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ipp-dark);
    margin-top: 5px;
}

.sidebar-toggle {
    display: none; /* Hide on desktop, show via media query */
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--ipp-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background var(--transition-speed);
}

.sidebar-toggle:hover {
    background: var(--ipp-light-gray);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--ipp-slate);
}

.breadcrumb a:hover {
    color: var(--ipp-green);
}

.breadcrumb .separator {
    color: var(--ipp-border);
}

.breadcrumb .current {
    color: var(--ipp-text);
    font-weight: 500;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-top: 10px;
}

/* GTranslate Wrapper - now in header-left */
.gtranslate-wrapper {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

/* User Profile Dropdown */
.header-user-wrapper {
    position: relative;
}

.header-user-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.header-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--ipp-soft-blue);
    background: var(--ipp-soft-blue);
}

.header-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Dropdown Popup */
.header-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #4AA3DF;
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1100;
    overflow: hidden;
}

.header-user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown arrow */
.header-user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #4AA3DF;
}

.dropdown-item {
    padding: 12px 20px;
    color: var(--ipp-white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item .dropdown-label {
    font-weight: 500;
}

.dropdown-item .dropdown-value {
    margin-left: auto;
}

.dropdown-logout {
    border-top: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-logout:hover {
    background: rgba(255,255,255,0.1);
}

.dropdown-logout i {
    color: #FF6B6B;
    font-size: 1.1rem;
}

/* ============================================
   PAGE CONTENT
   ============================================ */
#ipp-content {
    flex: 1;
    padding: 30px;
    background: var(--ipp-white);
}

/* Page Header */
.page-header {
    margin-bottom: 25px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ipp-dark);
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--ipp-text-light);
    font-size: 0.9375rem;
}

/* ============================================
   CARDS
   ============================================ */
.ipp-card {
    background: var(--ipp-white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    overflow: hidden;
}

.ipp-card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--ipp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ipp-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ipp-dark);
    margin: 0;
}

.ipp-card-body {
    padding: 25px;
}

.ipp-card-footer {
    padding: 15px 25px;
    border-top: 1px solid var(--ipp-border);
    background: var(--ipp-light-gray);
}

/* ============================================
   BUTTONS
   ============================================ */
.ipp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.ipp-btn-primary {
    background: var(--ipp-green);
    color: var(--ipp-dark);
}

.ipp-btn-primary:hover {
    background: var(--ipp-green-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(142, 255, 94, 0.4);
}

.ipp-btn-secondary {
    background: var(--ipp-slate);
    color: var(--ipp-white);
}

.ipp-btn-secondary:hover {
    background: #5d6880;
}

.ipp-btn-outline {
    background: transparent;
    border: 2px solid var(--ipp-slate);
    color: var(--ipp-slate);
}

.ipp-btn-outline:hover {
    background: var(--ipp-slate);
    color: var(--ipp-white);
}

.ipp-btn-info {
    background: var(--ipp-soft-blue);
    color: var(--ipp-dark);
}

.ipp-btn-info:hover {
    background: #8fafc6;
}

.ipp-btn-success {
    background: var(--ipp-success);
    color: var(--ipp-dark);
}

.ipp-btn-warning {
    background: var(--ipp-warning);
    color: var(--ipp-dark);
}

.ipp-btn-danger {
    background: var(--ipp-danger);
    color: var(--ipp-white);
}

.ipp-btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.ipp-btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.ipp-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
}

.ipp-btn-icon.ipp-btn-sm {
    width: 28px;
    height: 28px;
}

/* ============================================
   DATA TABLES
   ============================================ */
.ipp-table-wrapper {
    overflow-x: auto;
}

.ipp-table {
    width: 100%;
    border-collapse: collapse;
}

.ipp-table thead {
    background: var(--ipp-light-gray);
}

.ipp-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ipp-text-light);
    border-bottom: 2px solid var(--ipp-border);
}

.ipp-table td {
    padding: 15px;
    border-bottom: 1px solid var(--ipp-border);
    font-size: 0.9375rem;
    vertical-align: middle;
}

.ipp-table tbody tr:hover {
    background: rgba(162, 187, 207, 0.1);
}

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

/* Table Controls */
.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.table-controls-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.entries-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.entries-select select {
    padding: 6px 10px;
    border: 1px solid var(--ipp-border);
    border-radius: 5px;
    background: var(--ipp-white);
    font-family: var(--font-primary);
}

.table-search {
    position: relative;
}

.table-search input {
    padding: 8px 15px 8px 40px;
    border: 1px solid var(--ipp-border);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    width: 250px;
    transition: border-color var(--transition-speed);
}

.table-search input:focus {
    outline: none;
    border-color: var(--ipp-green);
}

.table-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ipp-text-light);
}

/* Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--ipp-border);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--ipp-text-light);
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.pagination-btn {
    padding: 8px 14px;
    border: 1px solid var(--ipp-border);
    background: var(--ipp-white);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--ipp-green);
    border-color: var(--ipp-green);
    color: var(--ipp-dark);
}

.pagination-btn.active {
    background: var(--ipp-green);
    border-color: var(--ipp-green);
    color: var(--ipp-dark);
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   FORMS
   ============================================ */
.ipp-form-group {
    margin-bottom: 20px;
}

.ipp-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ipp-text);
    margin-bottom: 6px;
}

.ipp-form-control {
    width: 100%;
    padding: 10px 15px;
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    border: 1px solid var(--ipp-border);
    border-radius: 6px;
    background: var(--ipp-white);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.ipp-form-control:focus {
    outline: none;
    border-color: var(--ipp-green);
    box-shadow: 0 0 0 3px rgba(142, 255, 94, 0.2);
}

.ipp-form-control::placeholder {
    color: var(--ipp-text-light);
}

select.ipp-form-control {
    cursor: pointer;
}

textarea.ipp-form-control {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   STATUS BADGES
   ============================================ */
.ipp-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ipp-badge-success {
    background: rgba(142, 255, 94, 0.2);
    color: #4a9c2e;
}

.ipp-badge-warning {
    background: rgba(255, 179, 71, 0.2);
    color: #c47f00;
}

.ipp-badge-danger {
    background: rgba(255, 107, 107, 0.2);
    color: #c44040;
}

.ipp-badge-info {
    background: rgba(162, 187, 207, 0.3);
    color: #4a6b85;
}

.ipp-badge-neutral {
    background: var(--ipp-light-gray);
    color: var(--ipp-text-light);
}

/* ============================================
   BOOKING STATUS COLORS (Calendar)
   ============================================ */
.booking-confirmed {
    background: var(--ipp-green) !important;
    color: var(--ipp-dark) !important;
}

.booking-reserved {
    background: var(--ipp-soft-blue) !important;
    color: var(--ipp-dark) !important;
}

.booking-blocked {
    background: var(--ipp-slate) !important;
    color: var(--ipp-white) !important;
}

.booking-checkout {
    background: var(--ipp-warning) !important;
    color: var(--ipp-dark) !important;
}

.booking-checkin {
    background: var(--ipp-info) !important;
    color: var(--ipp-dark) !important;
}

/* ============================================
   FOOTER
   ============================================ */
#ipp-footer {
    padding: 15px 30px;
    text-align: center;
    color: var(--ipp-text-light);
    font-size: 0.75rem;
    background: var(--ipp-white);
}

/* ============================================
   RESPONSIVE - Collapsed Sidebar (not needed with icon-only)
   ============================================ */
.sidebar-collapsed #ipp-sidebar {
    width: var(--sidebar-width);
}

.sidebar-collapsed #ipp-main {
    margin-left: var(--sidebar-width);
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 991px) {
    #ipp-sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar-open #ipp-sidebar {
        transform: translateX(0);
    }
    
    #ipp-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-open .sidebar-overlay {
        display: block;
    }
    
    .header-branding .brand-line-2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    #ipp-content {
        padding: 20px 15px;
    }
    
    #ipp-header {
        padding: 15px 20px;
        min-height: auto;
    }
    
    .header-branding .brand-line-1 {
        font-size: 1.1rem;
    }
    
    .header-branding .brand-line-2 {
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    
    .header-branding .brand-tagline {
        font-size: 0.875rem;
    }
    
    .ipp-card-body {
        padding: 15px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search input {
        width: 100%;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }

/* Grid */
.ipp-row {
    display: flex;
    flex-wrap: wrap;
    margin: -12px;
}

.ipp-col {
    padding: 12px;
}

.ipp-col-12 { width: 100%; }
.ipp-col-6 { width: 50%; }
.ipp-col-4 { width: 33.333%; }
.ipp-col-3 { width: 25%; }

@media (max-width: 768px) {
    .ipp-col-md-12 { width: 100%; }
    .ipp-col-md-6 { width: 50%; }
}

@media (max-width: 576px) {
    .ipp-col-sm-12 { width: 100%; }
}

/* ============================================
   MOBILE RESPONSIVE - Icon-only Sidebar
   Override the default 991px hide behavior
   ============================================ */
@media (max-width: 991px) {
    
    /* Override: Keep sidebar visible as icon strip */
    #ipp-sidebar {
        width: 60px !important;
        transform: translateX(0) !important;
    }
    
    /* Main content - adjust for narrow sidebar */
    #ipp-main {
        margin-left: 60px !important;
    }
    
    /* Hide hamburger toggle - sidebar always visible */
    .sidebar-toggle {
        display: none !important;
    }
    
    /* Hide overlay - not needed */
    .sidebar-overlay {
        display: none !important;
    }
    
    .sidebar-logo {
        padding: 12px 8px;
    }
    
    .sidebar-logo img,
    .sidebar-logo .custom-logo-link img {
        max-width: 40px;
        padding: 6px;
    }
    
    .sidebar-logo .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    /* Hide nav text, show icons only */
    .sidebar-nav .nav-text {
        display: none !important;
    }
    
    .sidebar-nav .nav-link {
        justify-content: center;
        padding: 12px 8px;
        border-right-width: 4px;
    }
    
    .sidebar-nav .nav-link .nav-icon {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    
    /* Tooltip on hover/tap for mobile */
    .sidebar-nav .nav-link {
        position: relative;
    }
    
    .sidebar-nav .nav-link::after {
        content: attr(data-tooltip);
        display: block;
        position: absolute;
        left: 65px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--ipp-dark);
        color: var(--ipp-white);
        padding: 6px 12px;
        border-radius: 4px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
        z-index: 1001;
        pointer-events: none;
    }
    
    .sidebar-nav .nav-link:hover::after,
    .sidebar-nav .nav-link:focus::after,
    .sidebar-nav .nav-link:active::after {
        opacity: 1;
        visibility: visible;
    }
    
    /* Hide sidebar user section on mobile */
    .sidebar-user {
        display: none;
    }
    
    /* Header - Compact layout */
    #ipp-header {
        padding: 8px 10px !important;
        min-height: auto !important;
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .header-left {
        display: flex !important;
        flex-direction: column;
        gap: 2px;
    }
    
    /* Flags in header-left */
    .header-left .gtranslate-wrapper {
        margin-top: 5px;
    }
    
    /* Branding - Compact but VISIBLE */
    .header-branding {
        display: flex !important;
        flex-direction: column;
        gap: 0;
    }
    
    .header-branding .brand-line-1 {
        display: block !important;
        font-size: 0.7rem !important;
        margin-bottom: 0;
        color: var(--ipp-green) !important;
    }
    
    .header-branding .brand-line-2 {
        display: block !important;
        font-size: 1rem !important;
        letter-spacing: 0;
    }
    
    .header-branding .brand-line-2 .green {
        color: var(--ipp-green) !important;
    }
    
    .header-branding .brand-line-2 .gray {
        color: var(--ipp-slate) !important;
    }
    
    .header-branding .brand-tagline {
        display: block !important;
        font-size: 0.6rem !important;
        margin-top: 1px;
        color: var(--ipp-dark) !important;
    }
    
    /* Header right - HIDE on mobile (only has user icon now) */
    .header-right {
        display: none !important;
    }
    
    /* Content area */
    #ipp-content {
        padding: 15px 12px;
    }
    
    /* Page titles */
    .ipp-page-header h1 {
        font-size: 1.25rem;
    }
    
    /* Cards */
    .ipp-card {
        border-radius: 6px;
    }
    
    .ipp-card-header {
        padding: 12px 15px;
    }
    
    .ipp-card-body {
        padding: 12px 15px;
    }
    
    /* Tables - horizontal scroll */
    .ipp-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ipp-table {
        min-width: 600px;
    }
    
    .ipp-table th,
    .ipp-table td {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }
    
    /* Table controls stack */
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .table-controls-left {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search input {
        width: 100%;
    }
    
    /* Pagination */
    .table-pagination {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Forms */
    .ipp-form-control {
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Grid adjustments */
    .ipp-col-6,
    .ipp-col-4,
    .ipp-col-3 {
        width: 100%;
    }
    
    /* Footer */
    #ipp-footer {
        padding: 12px 15px;
        font-size: 0.7rem;
    }
    
    /* ============================================
       SIDEBAR EXPANDED STATE (Two-tap navigation)
       ============================================ */
    
    /* Show overlay when expanded */
    .sidebar-expanded .sidebar-overlay {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }
    
    /* Expand sidebar to full width */
    .sidebar-expanded #ipp-sidebar {
        width: 220px !important;
        z-index: 1001;
    }
    
    /* Show nav text when expanded */
    .sidebar-expanded .sidebar-nav .nav-text {
        display: block !important;
        color: var(--ipp-light-gray);
    }
    
    /* Reset nav link layout when expanded */
    .sidebar-expanded .sidebar-nav .nav-link {
        justify-content: flex-start;
        padding: 12px 15px;
        gap: 12px;
    }
    
    /* Hide tooltips when expanded (text is visible) */
    .sidebar-expanded .sidebar-nav .nav-link::after {
        display: none !important;
    }
    
    /* Restore logo size when expanded */
    .sidebar-expanded .sidebar-logo {
        padding: 20px 15px;
    }
    
    .sidebar-expanded .sidebar-logo img,
    .sidebar-expanded .sidebar-logo .custom-logo-link img {
        max-width: 55px;
        padding: 10px;
    }
    
    /* Hover effect when expanded */
    .sidebar-expanded .sidebar-nav .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }
    
    .sidebar-expanded .sidebar-nav .nav-link:hover .nav-text {
        color: var(--ipp-white);
    }
}

/* ============================================
   EXTRA SMALL SCREENS (< 480px)
   ============================================ */
@media (max-width: 480px) {
    
    #ipp-sidebar {
        width: 50px !important;
    }
    
    #ipp-main {
        margin-left: 50px !important;
    }
    
    .sidebar-logo {
        padding: 10px 5px;
    }
    
    .sidebar-logo img,
    .sidebar-logo .custom-logo-link img {
        max-width: 35px;
        padding: 5px;
    }
    
    .sidebar-nav .nav-link {
        padding: 10px 5px;
    }
    
    .sidebar-nav .nav-link .nav-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
    
    .sidebar-nav .nav-link::after {
        left: 55px;
    }
    
    .header-branding .brand-line-2 {
        font-size: 0.95rem;
    }
    
    #ipp-content {
        padding: 12px 10px;
    }
    
    /* Expanded state on small screens */
    .sidebar-expanded #ipp-sidebar {
        width: 200px !important;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger tap targets */
    .sidebar-nav .nav-link {
        min-height: 48px;
    }
    
    .ipp-btn,
    .pagination-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects that don't work on touch */
    .sidebar-nav .nav-link:hover {
        background: transparent;
    }
    
    .sidebar-nav .nav-link:active {
        background: rgba(255,255,255,0.1);
    }
}
